I don\'t understand why this code does not work.
foreach (DataRow dataRow in dataTable.Rows) { if (true) { dataRow.Delete(); } } <
foreach (DataRow dataRow in dataTable.Rows) { if (true) { dataRow.Delete(); } }
Use this:
for (int i = 0; i < myDataTable.Rows.Count; i++) { myDataTable[i].Delete(); }