以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  [求助] 复制datatable的信息  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=119257)

--  作者:zxmonkey
--  发布时间:2018/5/21 16:37:00
--  [求助] 复制datatable的信息
各位大侠求助
 
当前表A 中需要复制 表A所在datatable中有最近相同货号的货描列, 编下面的语句但是没反应啊, 求助


For Each r As Row In Tables("表A").Rows
Dim dr As DataRow  = DataTables("表A").Find("货号 = \'" & r("货号") & "\'")
    If dr IsNot Nothing Then 
        r("货描")=dr("货描")
    End If
Next

--  作者:有点甜
--  发布时间:2018/5/21 16:42:00
--  

For Each r As Row In Tables("表A").Rows
    Dim dr As DataRow  = DataTables("表A").Find("货号 = \'" & r("货号") & "\' and 货描 is not null")
    If dr IsNot Nothing Then
        r("货描")=dr("货描")
    End If
Next

 

或者

 

Tables("表A").sort = "货号,货描 desc"
Dim pr As Row = Nothing
For Each r As Row In Tables("表A").Rows
    If pr IsNot Nothing Then
        If pr("货号") = r("货号") Then
            r("货描")=pr("货描")
        End If
    End If
    pr = r
Next


--  作者:zxmonkey
--  发布时间:2018/5/22 10:35:00
--  
谢谢大侠!