How do I delete a row from a DataTable?
Mohan Gupta
YourDataTable.AcceptChanges(); foreach (DataRow row in YourDataTable.Rows) {// If this row is offensive thenrow.Delete();} YourDataTable.AcceptChanges();
RemoveAt()
DataRow dr = dt.Rows[0] as DataRow;if (dr["id"].Equals(1)){dr.Delete();}dt.AcceptChanges();
The below code will help you to delete the recode from a datatable DataRow[] drr = dt.Select("Student=' " + id + " ' "); for (int i = 0; i < drr.Length; i++) drr[i].Delete(); dt.AcceptChanges(); asp-net-corner.blogspot.in/