1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
| ///////////////////// Création du Numéro de Ticket Automatiquement au chargement de la page //////////////////////
cmd1.CommandText = "insert into siteform (fdate,name,urgence,descr,email) values (null,null,null,null,null)";
cn.Open();
cmd1.Connection = cn;
try
{
cmd1.ExecuteNonQuery();
}
catch (Exception)
{
Response.Redirect("page_exeption.htm");
}
cmd1.Clone();
cn.Close();
//////////////////////// Récupération du numéro de ticket et le mettre dans un Label///////////////////////////
cmd2.CommandText = "select nticket from siteform where fdate is null and name is null and urgence is null and descr is null and email is null ";
cn.Open();
cmd2.Connection = cn;
try
{
Label1.Text=(string)cmd2.ExecuteScalar().ToString();
}
catch (Exception)
{
Response.Redirect("page_exeption.htm");
}
cmd2.Clone();
cn.Close(); |
Partager