大师,在导入的时候一直会提示一个错误,
下面是导入的代码:
Dim dlg As New OpenFileDialog
dlg.Filter= "Excel文件|*.xls;*.xlsx"
If dlg.ShowDialog = DialogResult.Ok Then
If FileSys.FileExists(dlg.FileName) Then
Dim Book As New XLS.Book(dlg.FileName)
Dim Sheet As XLS.Sheet = Book.Sheets(0)
Tables("main").StopRedraw()
'注意以下数组中列名称的顺序,必须和Excel表中的列顺序一致
Dim nms() As String = {"jieshoujigou","changjia","songdanwei","xinghao","xuliehao","beijianid","guzhang"}
'注意下面的循环变量从1开始,而不是从0开始,因为Excel表的第一行是标题
For n As Integer = 1 To Sheet.Rows.Count -1
Dim bh As String = sheet(n,0).Text
If DataTables("main").Find("xuliehao = '" & bh & "'") Is Nothing Then '如果不存在同编号的订单
Dim r As Row = Tables("main").AddNew()
For m As Integer = 0 To nms.Length - 1
r(nms(m)) = Sheet(n,m).Value
Next
End If
Next
Tables("main").ResumeRedraw()
End If
End If
错误提示:怎么修改一下代码?
此主题相关图片如下:qq图片20140427201427.jpg