- Back to Home »
- ADO.NET »
- Disconnected Architecture Delete
Posted by :
Sudhir Chekuri
Saturday, 12 March 2016
//Disconnected architecture - delete
//Delete product
private void BtnDeleteProduct_Click(object
sender, EventArgs e)
{
//SqlCommand to delete Product
SqlCommand cmd = new SqlCommand("exec Usp_DeleteProduct
'"+CBExistingCategories.Text+"','"+CBExistingProducts.Text+"'", con);
DataSet ds = new DataSet();
SqlDataAdapter da = new SqlDataAdapter(cmd);
da.Fill(ds);
//Update Products
PopulateProducts();
//Clear product details
TxtDescription.Text = "";
NudPrice.Value = 1;
MessageBox.Show("Product Deleted
Successfully");