1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| connection = new SqlConnection("Data Source=DIST-5B8D87E3A9;Initial Catalog=DistribInfo;Integrated Security=SSPI");
command = new SqlCommand("SELECT C_NOMCLT FROM CLIENT", connection);
command.Parameters.Add("@nomclt", SqlDbType.Int);
command.Parameters["@nomclt"].Value = "NomClient.Text";
command.Parameters.Add("@nomclt", varchar);
try
{
connection.Open();
Int32 rowsAffected = command.ExecuteNonQuery();
Console.WriteLine("RowsAffected: {0}", rowsAffected);
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
} |