Posted by : Sudhir Chekuri Saturday, 12 March 2016

//Disconnected Insert
        //Adding product
        private void BtnAddProduct_Click(object sender, EventArgs e)
        {
SqlConnection con =new SqlConnection (@"Data Source=DESKTOP-LEBFFH4\PRESS;Initial Catalog=STUDENT;Integrated Security=True");
            //SqlCommand to insert Product
            SqlCommand cmd = new SqlCommand("exec Usp_InsertProduct '" + CBExistingCategories.Text + "','" + TxtAddProduct.Text + "','" + TxtDescription.Text + "'," + NudPrice.Value+ "", con);
            DataSet ds = new DataSet();
            SqlDataAdapter da = new SqlDataAdapter(cmd);
            da.Fill(ds);
                MessageBox.Show("Product Added Successfully");
         

        }



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 -