首先定義數組,我是同事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語句中使用。