Foxtable(狐表)用户栏目专家坐堂 → 赋值语法求助


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

主题:赋值语法求助

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


加好友 发短信
等级:五尾狐 帖子:1165 积分:8129 威望:0 精华:0 注册:2015/3/30 10:44:00
赋值语法求助  发帖心情 Post By:2017/10/23 18:42:00 [显示全部帖子]

Dim result As New System.Data.DataTable
SqlDataAdapter.Fill(result)
If result.Rows.Count >= 2  and Then
Dim id_flag As String 'id_flag是列名
For Each drr As DataRow In result.Rows
  id_flag &= '" & drr("id_flag") & "' & "or"---------这么写肯定不对,那么应该怎么写?循环到最后一行or不要。
 Next
                    
strS ql = "sel ect * from [可用数量表]  where " & “(” & "id_flag" & ")"
End if

问题很简单,我就是希望循环result表的行,如果行数大于等于2,比如行数为3行,第一行的drr("id_flag") = 1,第二行的drr("id_flag") = 2 ,第三行的drr("id_flag")  = 3.
然后希望strsql变为下面的。
strS ql = "sel ct * from [可用数量表]  where " & “(” & id_flag = "1" or id_flag = "2" or id_flag = "3" & ")"

 回到顶部