Foxtable(狐表)用户栏目专家坐堂 → for语句怎么改成case语句啊?麻烦指点一下奥~


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

主题:for语句怎么改成case语句啊?麻烦指点一下奥~

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


加好友 发短信
等级:五尾狐 帖子:1062 积分:9781 威望:0 精华:0 注册:2012/3/13 5:23:00
for语句怎么改成case语句啊?麻烦指点一下奥~  发帖心情 Post By:2015/10/23 12:46:00 [只看该作者]

 

For Each dr1 As DataRow In DataTables("商品").Select("[length] ='al' or [length] ='apm' ") '20

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

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

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

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

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

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

dr6(Cols6(i)) = dr1(Cols1(i))

dr7(Cols7(i)) = dr1(Cols1(i))

dr8(Cols8(i)) = dr1(Cols1(i))

Next

Next

 

For Each dr1 As DataRow In DataTables("商品").Select("[length] ='de' or [length] ='nuzz' or [length] ='a6' or [length] ='1ph'")  '30

Dim dr9 As DataRow = DataTables("miyadn").AddNew()

Dim dr10 As DataRow = DataTables("tianma2dn").AddNew()   

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

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

Dim dr6 As DataRow = DataTables("ivandn").AddNew()

Dim dr7 As DataRow = DataTables("xinliangdn").AddNew()

Dim dr10 As DataRow = DataTables("yunfengdn").AddNew()

Dim dr12 As DataRow = DataTables("dalongdn").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))

dr6(Cols6(i)) = dr1(Cols1(i))

dr7(Cols7(i)) = dr1(Cols1(i))

 

dr10(Cols10(i)) = dr1(Cols1(i))

dr12(Cols12(i)) = dr1(Cols1(i))

Next

Next

 

 

For Each dr1 As DataRow In DataTables("商品").Select("[length] <>'uus' or [length] 'qn' ")  40

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

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

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

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

Dim dr6 As DataRow = DataTables("ivanuus").AddNew()

Dim dr7 As DataRow = DataTables("xinlianguus").AddNew()

Dim dr10 As DataRow = DataTables("yunfenguus").AddNew()

Dim dr12 As DataRow = DataTables("dalonguus").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))

dr6(Cols6(i)) = dr1(Cols1(i))

dr7(Cols7(i)) = dr1(Cols1(i))

 

dr10(Cols10(i)) = dr1(Cols1(i))

dr12(Cols12(i)) = dr1(Cols1(i))

Next

Next

 

 

 

上面是我做的代码,只是其中的一部分, 如果要按照上面的形式一直写下去的话,实在是太多了所以想想是不是能换成case语句

意图是 主要根据 lei的列 来选择要将数据插入到哪个表中

 

请各位大侠指点啊,实在是不会!!非常感谢!!!


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


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

不能改,你每种的筛选,要做的功能都不一样,只能这样写。


 回到顶部