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(); } }
Sure Magents
This is how I did it and works fine
dt = GetStationeryConsolidationDetails(txtRefNo.Text); int intRows = dt.Rows.Count; int x = 0; for (int c = 0; c < intRows; c++) { if (dt.Rows[c - x]["DQTY"].ToString() == "0") { dt.Rows[c - x].Delete(); dt.AcceptChanges(); x++; } }