Posted by :
Sudhir Chekuri
Saturday, 12 March 2016
//Connected Architecture - update
//Update Category
private void BtnUpdateCategory_Click(object sender, EventArgs e)
{
//SqlCommand to update Category
SqlCommand cmd = new SqlCommand("exec Usp_UpdateCategory
'"+CBExistingCategories.Text+"','"+TxtUpdateCategory.Text+"'", con);
//Open connection
con.Open();
//Execute update command
int i = cmd.ExecuteNonQuery();
con.Close();
if (i > 0)
{
//Refresh Category list
PopulateCategories();
//Show first Category
CBExistingCategories.SelectedIndex = 0;
MessageBox.Show("Category Updated
Successfully");
}
else { MessageBox.Show("Category Not Updated"); }