以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  交集代码出错  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=122075)

--  作者:ZJZK2018
--  发布时间:2018/7/18 15:51:00
--  交集代码出错
老师:

下面这段代码出错,如何调整?谢谢!

Dim lst As new List(Of String)
For i As Integer = 1 To 20
    lst.Add(Cstr(i))
Next

Dim lis2 As New List(of String)
lis2 = DataTables("编号统计").GetValues("市内_入围编号","投标单位 in (\'" & lst & "\')")
Dim str As String = String.Join("|",lis2.ToArray)
msgbox(str)

--  作者:有点甜
--  发布时间:2018/7/18 15:58:00
--  

Dim lst As new List(Of String)
For i As Integer = 1 To 20
    lst.Add(Cstr(i))
Next

Dim str As String = String.Join("\',\'",lst.ToArray)
msgbox(str)
Dim lis2 As List(Of String) = DataTables("编号统计").GetValues("市内_入围编号","投标单位 in (\'" & str & "\')")


--  作者:ZJZK2018
--  发布时间:2018/7/18 16:23:00
--  
老师你好:
我主要是比较的是整数型,而不是字符型,下面代码出错,如何调整?

Dim lst As new List(Of Integer)
For i As Integer = 1 To 20
    lst.Add(i)
Next
Dim Arys() As Integer
Arys = lst.ToArray
Dim lst2 As List(Of Integer) = DataTables("编号统计").GetValues("市内_入围编号","投标单位 in (\'" & arys & "\')")
For Each ls As Integer In lst2
    msgbox(li)
Next


--  作者:有点甜
--  发布时间:2018/7/18 17:16:00
--  

Dim lst As new List(Of String)
For i As Integer = 1 To 20
    lst.Add(Cstr(i))
Next

Dim str As String = String.Join(",",lst.ToArray)
msgbox(str)
Dim lis2 As List(Of String) = DataTables("编号统计").GetValues("市内_入围编号","投标单位 in (" & str & ")")