1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| SqlCommand AjoutAgence1 = new SqlCommand("update Nomenclature SET Intitulé=@Intitulé, Paramètre1=@Paramètre1, DateDernièreModification=@DateDernièreModification, Poste=@Poste where Code=@Code)" , newconnection);
SqlParameter Code = new SqlParameter("@Code", SqlDbType.VarChar, 6);
SqlParameter Intitulé = new SqlParameter("@Intitulé", SqlDbType.VarChar, 6);
SqlParameter Paramètre1 = new SqlParameter("@Paramètre1", SqlDbType.VarChar, 6);
SqlParameter Poste = new SqlParameter("@Poste", SqlDbType.VarChar, 6);
SqlParameter DateDernièreModification = new SqlParameter("@DateDernièreModification", SqlDbType.VarChar, 6);
Code.Value = textBox1.Text;
Intitulé.Value = textBox2.Text;
Paramètre1.Value = textBox3.Text;
Poste.Value = Environment.MachineName;
DateDernièreModification.Value = DateTime.Now;
AjoutAgence1.Parameters.Add(Code);
AjoutAgence1.Parameters.Add(Intitulé);
AjoutAgence1.Parameters.Add(Paramètre1);
AjoutAgence1.Parameters.Add(Poste);
AjoutAgence1.Parameters.Add(DateDernièreModification);
newconnection.Open();
AjoutAgence1.ExecuteNonQuery();
newconnection.close(); |
Partager