Dim cmd As New SQLCommand
Dim dt As DataTable
cmd.C
cmd.CommandText = "Select*From{Tab_P_ProductRecord201011} Into {_Tab_P_ProductRecord2010}"
dt = cmd.ExecuteReader()
For Each dr As DataRow In dt.DataRows
If DataTables("Tab_P_ProductRecord201011").Find("ID = '" & dr("ID") & "'") Is Nothing Then
Dim nr As DataRow = DataTables("Tab_P_ProductRecord201011").AddNew()
For Each dc As DataCol In dt.DataCols
nr(dc.name) = dr(dc.name)
Next
End If
Next
代码执行出错,错误信息:
System.NullReferenceException:Object reference not set to an instance of an object at UserCode.Test()
错误代码位置;窗口5,Button4,Click
System.NullReferenceException:Object reference not set to an instance of an object at UserCode.Click_2df1b3cf(ControlEventArgs e)