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 上面代码的思路对么?