Mohan Gupta
How do I delete a row from a DataTable?
By Mohan Gupta in ADO.NET on Jul 01 2013
  • Bharathi Raja
    Jan, 2018 20

    YourDataTable.AcceptChanges(); foreach (DataRow row in YourDataTable.Rows) {// If this row is offensive thenrow.Delete();} YourDataTable.AcceptChanges();

    • 0
  • Bharathi Raja
    Jan, 2018 20

    YourDataTable.AcceptChanges(); foreach (DataRow row in YourDataTable.Rows) {// If this row is offensive thenrow.Delete();} YourDataTable.AcceptChanges();

    • 0
  • Sunil Babu
    Apr, 2016 3

    RemoveAt()

    • 0
  • Lalit Raghav
    May, 2015 13

    DataRow dr = dt.Rows[0] as DataRow;if (dr["id"].Equals(1)){dr.Delete();}dt.AcceptChanges();

    • 0
  • vijay sekaran
    Jul, 2013 2

    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/

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS