5
Reply

How do I delete a row from a DataTable?

Mohan Gupta

Mohan Gupta

Jul 01, 2013
1.8k
0

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

    Bharathi Raja
    January 20, 2018
    0

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

    Bharathi Raja
    January 20, 2018
    0

    RemoveAt()

    Sunil Babu
    April 03, 2016
    0

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

    Lalit Raghav
    May 13, 2015
    0

    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/

    vijay sekaran
    July 02, 2013
    0