表B加一列【外表编号】
If e.DataCol.Name = "核对" Then
If e.DataRow("核对") = True Then
Dim nma() As String = {"A1","A2","A3","A4"} 'A表数据来源列
Dim nmb() As String = {"B1","B2","B3","B4"} 'B表数据接收列
Dim dr As DataRow = DataTables("表B").find("外表编号 = '" & e.DataRow("_Identify") & "'")
If dr Is Nothing Then DataTables("表B").AddNew
For i As Integer = 0 To nma.Length - 1
dr(nmb(i)) = e.DataRow(nma(i))
Next
dr("外表编号") = e.DataRow("_Identify")
Else
DataTables("表B").deletefor("外表编号 = '" & e.DataRow("_Identify") & "'")
End If
End If