G
Guest
I have a typed DataSet with a DataTable in it(created by using the "Generate DataSet" of the DataAdapter). Sometimes, I want to delete all of the records in the DataTable and I use the following snippet:
Dim dr As DataRow
For Each dr In tbTable.Rows
dr.Delete()
Next
I have found that if I don't make a call to the DataAdapter's .Update function before I call the above snippet, I get the following error message:
"Collection was modified; Enumeration operation may not execute"
I really should be able to delete these records independently of what's on the SQL server. Why will it work only after an Update?
Michael
Dim dr As DataRow
For Each dr In tbTable.Rows
dr.Delete()
Next
I have found that if I don't make a call to the DataAdapter's .Update function before I call the above snippet, I get the following error message:
"Collection was modified; Enumeration operation may not execute"
I really should be able to delete these records independently of what's on the SQL server. Why will it work only after an Update?
Michael