@using WebMatrix.Data
@{
    if (Request["txtNom"] != null) {
        Database db = Database.Open("films");
        var sql = "insert into categories(nom) values (@0)";
        string nom = Request["txtNom"];
        db.Execute(sql, nom);
    }

}

<!DOCTYPE html>
<html lang="en">
<head>
    <title></title>
    <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
</head>
<body>
    <h2>Ajout d'une catégorie</h2>
    <form method="post">
        Nom: <input type="text" name="txtNom" value="" />
        <input type="submit" name="cmdAjouter" value="Ajouter" />
    </form>
</body>
</html>