//In form load event DC.SelectSta("select proName as Name,proComp as Company,proQty as Qty,proUnit as Unit from orderList", "orderList"); dataGridView1.DataSource = DC.dataSet; dataGridView1.DataMember = "orderList"; //delete Button click event try { DialogResult dr = MessageBox.Show("Do You want to delete the product details?", "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (dr == DialogResult.Yes) { dataGridView1.Rows.RemoveAt(dataGridView1.CurrentRow.Index); DC.adpt.Update(DC.dataSet, "orderList"); } } catch { }
if (dr == DialogResult.Yes) { DC.dataSet.Tables["orderList"].Rows[CurrentRow.Index].Delete(); DC.dataSet.AcceptChanges(); dataGridView1.DataSource = DC.dataSet; dataGridView1.DataMember = "orderList"; dataGridView1.DataBind(); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)