1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
|
protected void btnValider_Click(object sender, EventArgs e)
{
// Chaîne de connexion
string connectString = "Data Source=PROD005\\SQLEXPRESS;Initial Catalog=Gestion_de_Stock;Integrated Security=True";
// Objet connection
SqlConnection connection = new SqlConnection(connectString);
// Ouverture
connection.Open();
// Objet Command
SqlCommand Pro = new SqlCommand("UPDATE Produit SET QteStock = [QteStock - ('" + txtQteUtil.Text + "')] WHERE NomProd = ('" + DropDownList1 + "') ", connection);
//Execution de la requete
Pro.ExecuteNonQuery();
// Fermeture connection
connection.Close();
} |
Partager