Foxtable(狐表)用户栏目专家坐堂 → 分类插入


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

主题:分类插入

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


加好友 发短信
等级:五尾狐 帖子:1062 积分:9781 威望:0 精华:0 注册:2012/3/13 5:23:00
分类插入  发帖心情 Post By:2015/8/25 14:03:00 [只看该作者]

Dim Cols1() As String = {"costPrice","color","weight","length","eng_name","pic","cn_name","width","gongxiang","isCheck","mu","lei","addtime","ccc","lei","remarks","cs2","cs1","cs3","adddata","pinpaifenlei","spic","riqifenlei","ppic"}

Dim Cols2() As String = {"costPrice","color","weight","length","eng_name","pic","cn_name","width","gongxiang","isCheck","mu","lei","addtime","ccc","lei","remarks","cs2","cs1","cs3","adddata","pinpaifenlei","spic","riqifenlei","ppic"}

Dim Cols3() As String = {"costPrice","color","weight","length","eng_name","pic","cn_name","width","gongxiang","isCheck","mu","lei","addtime","ccc","lei","remarks","cs2","cs1","cs3","adddata","pinpaifenlei","spic","riqifenlei","ppic"}

Dim Cols4() As String = {"costPrice","color","weight","length","eng_name","pic","cn_name","width","gongxiang","isCheck","mu","lei","addtime","ccc","lei","remarks","cs2","cs1","cs3","adddata","pinpaifenlei","spic","riqifenlei","ppic"}

Dim Cols5() As String = For Each dr1 As DataRow In DataTables("商品").Select("[id] is not Null")

If e.DataCol.name="lei"= "鞋子" Then

Dim dr3 As DataRow = DataTables("bag").AddNew() 

Else If e.DataRow("lei")= "化妆品" Then

Dim dr4 As DataRow = DataTables("huzhuang").AddNew()

Else

Dim dr2 As DataRow = DataTables("xie").AddNew()

 

Dim dr3 As DataRow = DataTables("tianma2").AddNew()    

Dim dr4 As DataRow = DataTables("newtrj").AddNew()

Dim dr5 As DataRow = DataTables("bong").AddNew()

For i As Integer = 0 To Cols1.Length -1

dr2(Cols2(i)) = dr1(Cols1(i))

dr3(Cols3(i)) = dr1(Cols1(i))

dr4(Cols4(i)) = dr1(Cols1(i))

dr5(Cols5(i)) = dr1(Cols1(i))

End if

Next

 

 

这段代码我的意图是这样的

 

如果 lei字段 = 鞋子 then  将 lei=鞋子的所有行都添加到  xie 那个表

其他的添加到其他表

else 如果 lei 字段= 包  then 将 lei = 包 的所有行都添加到 bag 那个表

 

其他的添加到其他表

 

问题:

1 按钮代码不支持 e.datarow 。 该怎么改?

2 上面代码的思路对么?


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


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2015/8/25 14:42:00 [只看该作者]

你还好意思说你学了这么久狐表么?怎么连最基本的语法都不会。

 

Dim r As Row = Tables("表A").Current

If r("lei")= "鞋子" Then

 

ElseIf r("lei")= "化妆品" Then

 

End If


 回到顶部