if (NSFwithExtOrSerFound) { int count = 0; foreach (DataRow recRow in dtRec.Rows) { if (recRow[0].ToString() == "Contact Vibration Specialist") { count++; } } foreach (DataRow recRow in dtRec.Rows) { if (recRow[0].ToString() == "Contact Vibration Specialist") { count--; if (count > 0) { recRow[0] = string.Empty; recRow.Delete(); } } } }
recRow.Delete();
[System.InvalidOperationException] = {"Collection was modified; enumeration operation might not execute."}
dt.Rows.Remove(dr); dt.AcceptChanges();
for(int i=0; i < dtRec.Rows.Count; i++) { DataRow recRow = dtRec.Rows[i]; if (recRow[0].ToString() == "Contact Vibration Specialist") { count--; if (count > 0) { recRow[0] = string.Empty; recRow.Delete(); dtRec.AcceptChanges(); } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)