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

Popular posts from this blog

angular - Is it possible to get native element for formControl? -

unity3d - Rotate an object to face an opposite direction -

javascript - Why jQuery Select box change event is now working? -