用以下代码用TEXTBOX1的多行数值,在表A里筛选并加载多行数据,希望加载后的数据按TEXTBOX中的文本顺序进行排序,应该怎么改下代码?
Dim s11 As String
Dim lst1 As new List(of String)
Dim filter2 As String = "1=2"
With Forms("窗口1").Controls("textbox1")
For i1 As Integer = 0 To .Lines.Length - 1
s11 = .Lines(i1)
lst1.add(s11)
Next
End With
If s11 IsNot Nothing Then
Dim filter1 As String = "编码 in ('" & String.join("','",lst1) & "')"
Dim dra As List(Of DataRow) = DataTables("表A").SQLSelect( filter1)
Dim lst As new List(of String)
If dra.Count > 0 Then
For i As Integer = 0 To dra.Count-1
Dim a As String =dra(i)("编码")
lst.add(a)
Next
End If
Dim s1() As String = lst.ToArray
Dim filter As String = "1=2"
For Each s As String In s1
filter = filter & " or 编码 like '" & s & "%'"
Next
DataTables("表A").loadFilter = filter
DataTables("表A").load
End If