不能是自己的数据源问题:更新400条记录以内正常,400条记录后就提示下面的问题,如何解决?
(不能附件添加,图片上传不了)
函数如下:
Dim tb As String = args(0)
Dim key As String = args(1)
Dim cmd As New SQLCommand
Dim dt As DataTable
cmd.C
cmd.CommandText = "S ELECT * From {" & tb & "}"
dt = cmd.ExecuteReader()
Dim l As WinForm.Label = Forms("拷贝").Controls("Label1")
Dim i As Integer
l.Text = i
For Each dr As DataRow In dt.DataRows
i += 1
l.Text = i
If DataTables(tb).Find(key & " = '" & dr(key) & "'") Is Nothing Then
Dim nr As DataRow = DataTables(tb).AddNew()
For Each dc As DataCol In dt.DataCols
nr(dc.name) = dr(dc.name)
Next
nr.Save()
Else
For Each dc As DataCol In dt.DataCols
'nr(dc.name) = dr(dc.name)
DataTables(tb).ReplaceFor(dc.name, dr(dc.name) , key & "= '" & dr(key) & "'")
Next
DataTables(tb).Save()
End If
Next
msgbox("OK")
[此贴子已经被作者于2019/4/17 9:49:56编辑过]