For Each file As String In filesys .GetFiles("D:\数据存放") If file.EndsWith(".xls") OrElse file.EndsWith(".xlsx") Then Dim Book As New XLS.Book(file) Dim Sheet As XLS.Sheet = Book.Sheets(0) Dim dr As DataRow = DataTables("订单数据").Find("编号 = '" & sheet(4,1).text & "'") If dr Is Nothing Then dr = DataTables("订单数据").AddNew End If dr("零配件") = sheet(4,1).text dr("件数") = sheet(4,3).text dr("规格") = sheet(5,1).text dr("厚度") = sheet(5,3).text dr("颜色") = sheet(6,1).text End If Next
|