private void updatestock(int id) { DataSet DS = new DataSet(); DispatchData dispatchData = new DispatchData(); string result = string.Empty; DS = dispatchData.getStock(id); if (!Comman.Comman.IsDataSetEmpty(DS)) { string constr = ConfigurationManager.ConnectionStrings["projectConnection"].ConnectionString; using (SqlConnection con = new SqlConnection(constr)) { using (SqlCommand cmd = new SqlCommand("sp_StockUpdateDispatch")) { cmd.CommandType = CommandType.StoredProcedure; cmd.Connection = con; cmd.Parameters.AddWithValue("@tblStock", DS.Tables[0]); con.Open(); cmd.ExecuteNonQuery(); con.Close(); } } } }