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"); }
           
        }


Leave a Reply

Subscribe to Posts | Subscribe to Comments

Followers

Total Pageviews

Powered by Blogger.

- Copyright © 2013 DevStudent - Metrominimalist - Powered by Blogger - Designed by Johanes Djogan -