以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  数据追加有无更快的办法  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=102267)

--  作者:HJG_HB950207
--  发布时间:2017/6/16 13:39:00
--  数据追加有无更快的办法
A表有若干列,B表的列只有A表的部分列,将B表的全部记录追加到A表中

Dim nma() As String = {。。。。}
 Dim nmb() As String = {。。。。。}
    For  J As Integer = 0 To Tables("表b").Rows.Count-1
        Tables("表B").Position=J
        Dim dr As DataRow = DataTables("表A").AddNew

        For i As Integer = 0 To nma.Length - 1
            dr(nmb(i)) = Tables("表B").Current(nma(i))
        Next
    Next


采用以上代码,较慢,1万条记录要等好长时间,请教有无其他更快办法?
谢谢老师!

--  作者:有点色
--  发布时间:2017/6/16 14:12:00
--  
Dim nma() As String
Dim nmb() As String
Systemready = False
For Each r As Row In Tables("表B").Rows
    Dim dr As DataRow = DataTables("表A").AddNew   
    For i As Integer = 0 To nma.Length - 1
        dr(nmb(i)) = r(nma(i))
    Next
Next
Systemready = True