Ce code ne compile pas?
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 SqlConnection("Data Source=DIST-5B8D87E3A9;Initial Catalog=DistribInfo;Integrated Security=SSPI"); command = new SqlCommand("SELECT C_STATUCLT FROM CLIENT WHERE CLIENT.C_NOMCLT= @NomClt"); command.Parameters.Add("@NomClt", SqlDbType.VarChar); command.Parameters["@NomClt"].Value = NomClient; try { connection.Open(); Int32 rowsAffected = command.ExecuteNonQuery(); Console.WriteLine("RowsAffected: {0}", rowsAffected); } catch (Exception ex) { Console.WriteLine(ex.Message); } connection.Close();
Partager