I want to delete some rows from DataTable, but it gives an error like this,
Collection was modified; enumeration operation might not execute
I use for deleting this code,
foreach(DataRow dr in dtPerson.Rows){
if(dr["name"].ToString()=="Joe")
dr.Delete();
}
So, what is the problem and how to fix it? Which method do you advise?