Foxtable(狐表)用户栏目专家坐堂 → 将同一列的数据复制到另外一个表不同的列,如何串联。


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

主题:将同一列的数据复制到另外一个表不同的列,如何串联。

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


加好友 发短信 一级勋章 三级勋章 二级勋章
等级:超级版主 帖子:6318 积分:33945 威望:0 精华:10 注册:2008/8/31 20:56:00
  发帖心情 Post By:2012/1/30 12:05:00 [显示全部帖子]

这样看看行不行?

 

Select Case e.DataCol.Name
    Dim dt As DataTable = DataTables("o")
    Dim s As String = "B11 = '" & e.DataRow("C114") & "'"
Case "C11"
    Dim dr As DataRow = t.Find(s & " And G = '" & e.DataRow("C4") & "'" )
    If dr IsNot Nothing'如果找到,则设置各列内容
        dr("O")=e.DataRow("C11")
        dr("P")=e.DataRow("C12")
    End If
    Dim dr1 As DataRow = t.Find(s & " And W = '" & e.DataRow("C4") & "'" )
    If dr1 IsNot Nothing'如果找到,则设置各列内容
        dr1("A1")=e.DataRow("C11")
        dr1("B1")=e.DataRow("C12")
    End If
    Dim dr2 As DataRow = t.Find(s & " And C1 = '" & e.DataRow("C4") & "'" )
    If dr2 IsNot Nothing'如果找到,则设置各列内容
        dr2("G1")=e.DataRow("C11")
        dr2("H1")=e.DataRow("C12")
    End If
    Dim dr3 As DataRow = t.Find(s & " And I1 = '"  & e.DataRow("C4") & "'" )
    If dr3 IsNot Nothing'如果找到,则设置各列内容
        dr3("M1")=e.DataRow("C11")
        dr3("N1")=e.DataRow("C12")
    End If
End Select


 回到顶部