Foxtable(狐表)用户栏目专家坐堂 → [求助]这语句怎么编?


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

主题:[求助]这语句怎么编?

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


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2014/11/5 18:02:00 [显示全部帖子]

Select Case e.DataCol.Name
    Case "第四列","第五列","第六列","第七列"
       
        Dim Filter As String = "[编码] = '" & e.DataRow("编码") & "'"
        Dim drs As List(Of DataRow) = DataTables("表A").Select(Filter)
        For Each dr As DataRow In drs
            If dr.IsNull(e.DataCol.name) Then
                dr(e.DataCol.Name) = e.NewValue
            End If
        Next
End Select

 


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


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2014/11/5 19:45:00 [显示全部帖子]

Select Case e.DataCol.Name
    Case "第四列","第五列","第六列","第七列"
       
        Dim Filter As String = "[编码] = '" & e.DataRow("编码") & "'"
        Dim drs As List(Of DataRow) = DataTables("表A").Select(Filter)
        For Each dr As DataRow In drs
            If dr.IsNull(e.DataCol.name) = False Then
                dr(e.DataCol.Name) = e.NewValue
            End If
        Next
End Select


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


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2014/11/5 19:57:00 [显示全部帖子]

Select Case e.DataCol.Name
    Case "第四列","第五列","第六列","第七列"
        If e.NewValue <> Nothing Then
            Dim Filter As String = "[编码] = '" & e.DataRow("编码") & "'"
            Dim drs As List(Of DataRow) = DataTables("表A").Select(Filter)
            For Each dr As DataRow In drs
               
                dr(e.DataCol.Name) = e.NewValue
            Next
        End If
End Select

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


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2014/11/5 21:08:00 [显示全部帖子]

Dim cols() As String = {"第四列","第五列","第六列","第七列"}
For Each dr As DataRow In DataTables("表B").DataRows
    For Each c As String In Cols
        If dr.IsNull(c) = False Then
            Dim Filter As String = "[编码] = '" & dr("编码") & "'"
            Dim drs As List(Of DataRow) = DataTables("表A").Select(Filter)
            For Each fdr As DataRow In drs  
                fdr(c) = dr(c)
            Next
        End If      
    Next
Next

 回到顶部