-- 导入数据
此主题相关图片如下:qq截图20190103092552.png

Dim dz As String = e.Form.Controls("地址").value
Dim dx As String = e.Form.Controls("对象表").value
If dx IsNot Nothing Or dz IsNot Nothing Then
Dim t As Table = Tables(dx)
t.StopRedraw()
Dim Book As New XLS.Book(dz)
Dim Sheet As XLS.Sheet = Book.Sheets(0)
Dim count As Integer = 0
For n As Integer = 1 To Sheet.Rows.Count -1
Dim r As DataRow = t.DataTable.AddNew()
count = count+1
For i As Integer = 0 To sheet.Cols.Count -1
Dim cname As String = sheet(0, i).text
If t.Cols.Contains(cname) Then
r(cname) = sheet(n, i).Text
End If
Next
Next
t.ResumeRedraw()
messagebox.show("新增" & count & "条数据","提示")
Else
messagebox.show("请先选择导入对象和文件","提示")
End If
之前在自己电脑试的时候没有问题,现在测试报错,请大版帮忙看看...
此主题相关图片如下:qq截图20190103092531.png
