ado.net - Deleting row from DataRow[] in C# -
i have datarow array datarow[] drrequest
5 rows. iterating each row using foreach
, deleting rows using
foreach (datarow dr in drrequest) { dr.delete();
but afterwards drrequest.length
returning 5 instead of 0.
i can't use datatable
, need use datarow[]
datarow.delete
doesn't remove row datatable
. marks row "will deleted datasource if use dataadapter , call dataadapter.update". if want remove use remove
:
foreach (datarow dr in drrequest) { dr.table.rows.remove(dr); }
Comments
Post a Comment