G
G. Dean Blake
When I do this.....
myDA.SelectCommand.Parameters("@SCID").Value = scid
Dim dt As New DataTable
myDA.Fill(dt)
If dt.Rows.Count > 0 Then
Dim myRow As DataRow = dt.Rows(0)
For Each myRow In dt.Rows
dt.Rows.Remove(myRow)
Next
End If
I get this exception....
Collection was modified; enumeration operation may not execute.
Why?
Thanks,
Dean
myDA.SelectCommand.Parameters("@SCID").Value = scid
Dim dt As New DataTable
myDA.Fill(dt)
If dt.Rows.Count > 0 Then
Dim myRow As DataRow = dt.Rows(0)
For Each myRow In dt.Rows
dt.Rows.Remove(myRow)
Next
End If
I get this exception....
Collection was modified; enumeration operation may not execute.
Why?
Thanks,
Dean