As we have seen how to delete rows in a dataset in C#.Net, there are simple ways to do the same using SQL command object. All we need is an sql statement and an Object to do the job.
con.open();Common.cmd = new SqlCommand("delete from purchasepart where billno=" + b1, Common.con); Common.cmd.ExecuteNonQuery();con.close();
cmd object configure the delete statement and call the ExecuteNonQuery() , and will delete those rows you are specified. Keep in mind that the connection should kept open while the ExecuteNonQuery(); method invoked.