Here is the code I am talking about:
At the line "r[0].Delete()" the row is question is deleted from the datatable "dt". What I want to happen is that the row is removed from the DataRow[] array, but NOT the DataTable. Thank you.
Code:
MySQL con = new MySQL();
DataTable dt = new DataTable( "TEST" );
con.FillDataTable( "SELECT 1 AS ID, \"Name1\" AS Name;", ref dt, true );
con.FillDataTable( "SELECT 2 AS ID, \"Name2\" AS Name;", ref dt, false );
con.FillDataTable( "SELECT 3 AS ID, \"Name3\" AS Name;", ref dt, false );
con.FillDataTable( "SELECT 4 AS ID, \"Name4\" AS Name;", ref dt, false );
con.FillDataTable( "SELECT 5 AS ID, \"Name5\" AS Name;", ref dt, false );
con.FillDataTable( "SELECT 6 AS ID, \"Name6\" AS Name;", ref dt, false );
con.FillDataTable( "SELECT 7 AS ID, \"Name7\" AS Name;", ref dt, false );
DataRow[] r = dt.Select( "ID=4" );
r[0]["Name"] = "Test4";
dt.AcceptChanges();
r[0].Delete();
dt.AcceptChanges();
At the line "r[0].Delete()" the row is question is deleted from the datatable "dt". What I want to happen is that the row is removed from the DataRow[] array, but NOT the DataTable. Thank you.