首先定义数组,我是同事session传值的

实现代码如下:

Dim struser As New List(Of String)
struser = Session("chooseuser")
strruser = ""

For a = 0 To struser.Count - 1
If a = 0 Then
strruser = "'" & struser.Item(a).ToString.Trim & "'"
Else
strruser = strruser & " , " & "'" & struser.Item(a).ToString.Trim & "'"
End If
Next

然后就可以吧strruser带入到sql语句中使用。

以上就是【vb.net 数组参与SQL语句的查询范例】的全部内容了,欢迎留言评论进行交流!

赞(0) 踩(0)

与本文相关的软件

发表我的评论

最新评论

  1. 暂无评论