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 34
| private void update_cote(ref SqlTransaction transaction, ref SqlConnection DBconnection)
{
try
{
SqlCommand myCommand = new SqlCommand("updCote", connection);
myCommand.CommandType = CommandType.StoredProcedure;
SqlParameter parameterExempl = new SqlParameter("@Exemp", SqlDbType.Int);
parameterExempl.Value = Exemplaire;
myCommand.Parameters.Add(parameterExempl);
SqlParameter parameterCote = new SqlParameter("@cote", SqlDbType.VarChar, 100);
parameterCote.Value = txtCote.Text;
myCommand.Parameters.Add(parameterCote);
if (DBconnection.State != ConnectionState.Open)
{
DBconnection.Open();
}
myCommand.Transaction = transaction;
myCommand.ExecuteNonQuery();
}
catch (Exception ex)
{
throw ex;
}
}
} |