Foxtable(狐表)用户栏目专家坐堂 → [求助] 复制datatable的信息


  共有1570人关注过本帖树形打印复制链接

主题:[求助] 复制datatable的信息

帅哥哟,离线,有人找我吗?
zxmonkey
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:婴狐 帖子:29 积分:434 威望:0 精华:0 注册:2017/7/14 11:48:00
[求助] 复制datatable的信息  发帖心情 Post By:2018/5/21 16:37:00 [只看该作者]

各位大侠求助
 
当前表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

 回到顶部
帅哥哟,离线,有人找我吗?
有点甜
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By: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
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:婴狐 帖子:29 积分:434 威望:0 精华:0 注册:2017/7/14 11:48:00
  发帖心情 Post By:2018/5/22 10:35:00 [只看该作者]

谢谢大侠!

 回到顶部