以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- 分类插入 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=73724) |
-- 作者:jinzhengbe -- 发布时间: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 上面代码的思路对么? |
-- 作者:大红袍 -- 发布时间:2015/8/25 14:42:00 -- 你还好意思说你学了这么久狐表么?怎么连最基本的语法都不会。
Dim r As Row = Tables("表A").Current If r("lei")= "鞋子" Then
ElseIf r("lei")= "化妆品" Then
End If |