Posted by : Sudhir Chekuri Saturday, 12 March 2016

//Connected architecture - delete
        //Delete Category
        private void BtnDeleteCategory_Click(object sender, EventArgs e)
        {

            //SqlCommand to delete Category
            SqlCommand cmd = new SqlCommand("exec Usp_DeleteCategory '" + CBExistingCategories.Text + "'", con);
            //Open connection
            con.Open();
            //Execute delete command
            int i = cmd.ExecuteNonQuery();
            con.Close();

            if (i > 0)
            {
                //Refresh Category list
                PopulateCategories();
                MessageBox.Show("Category Deleted Successfully");

            }
            else { MessageBox.Show("Category Not Deleted"); }

        }


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 -