There is a dataTable. I loop through the lines with foreach . Under certain conditions, delete the line:
foreach( DataRow dr in dt) { If (dr["Name"} = "Bob") { dr.Delete(); dt.AcceptChanges(); } } During the subsequent loop traversal, the exception " Collection changed, possibly the enumeration operation will fail ." Will the enumeration operation actually not work correctly? And how do I properly remove rows from DataTable?