--
Dim cmd As New SQLCommand
Dim dt As DataTable
Dim sCols() As String = {"订单号","联系人电话","上门日期","时间"}
Dim dCols() As String = {"订单号","电话号码","截止日期","时间"}
cmd.C
cmd.CommandText = "SELEC T * From {shdd}"
dt = cmd.ExecuteReader()
\'For Each dr As DataRow In dt.DataRows
\'Dim nr As DataRow = DataTables("派工_Table1").AddNew()
\'For i As Integer =0 To sCols.Length -1
\'nr(dCols(i)) = dr(sCols(i))
\'Next
\'Next
\'
\'
\'dt = c
For Each dr As DataRow In dt.DataRows
Dim nr As DataRow = DataTables("派工_Table1").find("订单号=\'" & dr("订单号") & "\'")
If dr Is Nothing Then
dr = DataTables("派工_Table1").addnew
End If
For i As Integer =0 To sCols.Length -1
nr(dCols(i)) = dr(sCols(i))
Next
Next
msgbox("新增" & newcount & " " & "更新旧数据" & oldcount)
t.ResumeRedraw()
End If
\'
.NET Framework 版本:4.0.30319.42000
Foxtable 版本:2020.5.29.8
错误所在事件:窗口,派工,Button12,Click
详细错误信息:
未将对象引用设置到对象的实例。
谢谢,才开始学。
[此贴子已经被作者于2023/3/13 16:46:57编辑过]