其实很简单:
Dim Book As New XLS.Book("c:\data\abc.xls")
Dim Sheet As XLS.Sheet = Book.Sheets(0)
Tables("表A").StopRedraw()
For n As Integer = 1 To Sheet.Rows.Count -1
If sheet(n,1).Text > "" Then
Dim dr As DataRow = DataTables("表A").Find("考号 = '" & sheet(n,1).Text & "'")
If dr Is Nothing Then
dr = DataTables("表A").AddNew()
dr("考号") = sheet(n,1).Text
End If
dr("语文") = sheet(n,2).text
dr("数学") = sheet(n,3).text
dr("英语") = sheet(n,4).text
End If
Next
sheet = Book.Sheets(1)
For n As Integer = 1 To Sheet.Rows.Count -1
If sheet(n,1).Text > "" Then
Dim dr As DataRow = DataTables("表A").Find("考号 = '" & sheet(n,1).Text & "'")
If dr Is Nothing Then
dr = DataTables("表A").AddNew()
dr("考号") = sheet(n,1).Text
End If
dr("物理") = sheet(n,2).text
dr("化学") = sheet(n,3).text
dr("政治") = sheet(n,4).text
End If
Next
Tables("表A").ResumeRedraw()