vb.net 數組參與SQL語句的查詢范例
來源:懂視網
責編:小采
時間:2020-11-27 22:41:30
vb.net 數組參與SQL語句的查詢范例
vb.net 數組參與SQL語句的查詢范例:首先定義數組,我是同事session傳值的 代碼如下:Dim struser As New List(Of String)struser = Session(chooseuser)strruser = For a = 0 To struser.Count - 1If a = 0 Thenstrruser = ' & stru
導讀vb.net 數組參與SQL語句的查詢范例:首先定義數組,我是同事session傳值的 代碼如下:Dim struser As New List(Of String)struser = Session(chooseuser)strruser = For a = 0 To struser.Count - 1If a = 0 Thenstrruser = ' & stru

首先定義數組,我是同事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語句中使用。
聲明:本網頁內容旨在傳播知識,若有侵權等問題請及時與本網聯系,我們將在第一時間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com
vb.net 數組參與SQL語句的查詢范例
vb.net 數組參與SQL語句的查詢范例:首先定義數組,我是同事session傳值的 代碼如下:Dim struser As New List(Of String)struser = Session(chooseuser)strruser = For a = 0 To struser.Count - 1If a = 0 Thenstrruser = ' & stru