提示:集合已修改;枚举操作可能不会执行
总是错误提示:集合已修改;枚举操作可能不会执行
代码如下,本人拙,请问下面到底错在那? 不胜感激。
Dim ds As New DataSet
Dim dt As New DataTable
OdbcConnection1.Open()
OdbcDataAdapter1.Fill(ds, "ftpfiles")
For Each drow1 As DataRow In ds.Tables("ftpfiles").Rows
If drow1.Item("temp") = False Then
ds.Tables("ftpfiles").Rows.Remove(drow1)
Else : drow1.Item("temp") = False
End If
Next
Try
dt = ds.Tables("ftpfiles").GetChanges()
OdbcDataAdapter1.Update(dt)
ds.Tables("ftpfiles").AcceptChanges()
dt = Nothing
Catch ex As Exception
MsgBox(ex.Message)
End Try
OdbcConnection1.Close()