你再增加一个辅助列得了:逻辑列“已复制”。然后代码加一点点进去:
if e.DataRow("已复制") = false then
e.DataRow("已复制") = true
If e.DataCol.Name = "逻辑列名" AndAlso 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").AddNew
For i As Integer = 0 To nma.Length - 1
dr(nmb(i)) = e.DataRow(nma(i))
Next
End
If
end if