项目有三表A
表B
表C,想将表A ,表B的部分列复制到
表C,建了一个窗口1,加一个控件CheckBox1,在
表A 的DataColChanged事件中加
If e.DataCol.Name = "复制AB" AndAlso e.DataRow("复制AB") = True Then
Dim nma() As String = {"第一列","第二列"} 'A表数据来源列
Dim nmb() As String = {"第一列","第二列"} 'B表数据接收列
Dim dr As DataRow = DataTables("表C").AddNew
For i As Integer = 0 To nma.Length - 1
dr(nmb(i)) = e.DataRow(nma(i))
Next
End If
表 B的DataColChanged事件中加
If e.DataCol.Name = "复制AB" AndAlso e.DataRow("复制AB") = True Then
Dim nma() As String = {"第三列","第四列"} 'A表数据来源列
Dim nmb() As String = {"第三列","第四列"} 'B表数据接收列
Dim dr As DataRow = DataTables("表C").AddNew
For i As Integer = 0 To nma.Length - 1
dr(nmb(i)) = e.DataRow(nma(i))
Next
End If
现在的问题是不知如何写代码将表B的列复制到表C中,请教下老师
q
外部数据是sql201407