参照网上的模糊查询帮助,新建了个模糊查询窗口(窗口2),在输入框中输入内容,表中不显示文字,但是能够筛选出符合条件的行数,就是没显示文字,大家看看这段代码错在哪里?
Dim t As Table =Tables("窗口2_Table1")
Dim st,ls ,py,Lm,str,Lss As String
Dim Ts As String() = {"第一列","第二列","第三列","第四列"}
Dim drs As New List(of DataRow)
st = e.sender.Text.ToUpper
drs = DataTables("表A").Select("第一列 > ''")
If drs.count > 0 Then
If st IsNot Nothing Then
For Each Lm In Ts
For Each dr As DataRow In DataTables("表A").DataRows
py = GetPY(dr(Lm),True)
If dr(Lm).IndexOf(st)> -1 OrElse py.IndexOf(st) > -1 Then
If Ls Is Nothing Then
Ls = dr("_Identify")
Else
If Ls.IndexOf(dr("_Identify")) = -1 Then
ls+= "," & dr("_Identify")
End If
End If
If Lss Is Nothing Then
Lss = dr(Lm)
Else
If Lss.IndexOf(dr(Lm)) = -1 Then
Lss+ = "|" & dr(Lm)
End If
End If
End If
Next
Next
If ls IsNot Nothing Then
Ls ="[_Identify] In(" & Ls & ")"
Ls="select 第一列,第二列 ,第三列,第四列 from{表A} where " & Ls
t.Fill(Ls,True)
e.sender.ComboList = Lss
End If
End If
End If