Foxtable(狐表)用户栏目专家坐堂 → 自动添加


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

主题:自动添加

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


加好友 发短信
等级:童狐 帖子:208 积分:1416 威望:0 精华:0 注册:2013/6/1 23:24:00
  发帖心情 Post By:2014/2/21 9:11:00 [只看该作者]

请问,多列添加的话,是这样写代码代码?

If e.DataCol.name="第一列" AndAlso e. DataRow.isnull("第一列")=False Then
    Dim dr As DataRow = DataTables("表B").Find("ID = " & e.DataRow("_Identify"))
    If dr  Is Nothing Then
        dr = DataTables("表B").addnew
        dr("ID") = e.DataRow("_Identify")
        dr("第一列")=e.DataRow("第一列")
    End If
    dr("第一列")=e.DataRow("第一列")
End If

 

If e.DataCol.name="第二列" AndAlso e. DataRow.isnull("第二列")=False Then
    Dim dr As DataRow = DataTables("表B").Find("ID = " & e.DataRow("_Identify"))
    If dr  Is Nothing Then
        dr = DataTables("表B").addnew
        dr("ID") = e.DataRow("_Identify")
        dr("第二列")=e.DataRow("第二列")
    End If
    dr("第二列")=e.DataRow("第二列")
End If

 

......

 

还是说有简单的方式,BIN老师说的多一行代码是咋写呢?请指教,谢谢。

[此贴子已经被作者于2014-2-21 9:11:36编辑过]

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


加好友 发短信
等级:童狐 帖子:208 积分:1416 威望:0 精华:0 注册:2013/6/1 23:24:00
  发帖心情 Post By:2014/2/21 13:17:00 [只看该作者]

顶一下。。。。


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


加好友 发短信
等级:贵宾 帖子:35433 积分:178524 威望:0 精华:3 注册:2013/3/30 16:36:00
  发帖心情 Post By:2014/2/21 14:11:00 [只看该作者]

If e.DataCol.name="第一列" AndAlso e. DataRow.isnull("第一列")=False Then
    Dim dr As DataRow = DataTables("表B").Find("ID = " & e.DataRow("_Identify"))
    If dr  Is Nothing Then
        dr = DataTables("表B").addnew
        dr("ID") = e.DataRow("_Identify")
    End If
    dr("第一列")=e.DataRow("第一列")
   dr("第二列")=e.DataRow("第二列")
End If

 回到顶部
总数 23 上一页 1 2 3