以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  二个表数据合并到一个临时表中如何处理  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=96358)

--  作者:有点色
--  发布时间:2017/2/19 10:29:00
--  

 

Dim s1 As List(Of String) = DataTables("表A").GetValues("第一列", "第一列 is not null")
Dim s2 As List(Of String) = DataTables("表B").GetValues("第一列", "第一列 is not null")
For Each s As String In s1
    Dim fdr As DataRow = DataTables("表D").Find("第一列 = \'" & s & "\'")
    If fdr Is Nothing Then
        fdr = DataTables("表D").AddNew
        fdr("第一列") = s
    End If
Next
For Each s As String In s2
    Dim fdr As DataRow = DataTables("表D").Find("第一列 = \'" & s & "\'")
    If fdr Is Nothing Then
        fdr = DataTables("表D").AddNew
        fdr("第一列") = s
    End If
Next