我编写了一个筛选的函数,但提示 无法在 System.Boolean 和 System.String 上执行“Like”操作。
st1 代表筛选的列 st2 代表要筛选的内容,如果用空格隔开,代表,多条件筛选
请老师帮忙看下,那么有问题,谢谢
Dim t As Table = CurrentTable
Dim st1 As String = "项目名称,项目特征"
Dim cls() As String = st1.Split(",")
Dim st2 As String = "C30 砼"
Dim txts() As String = st2.Split(" ")
Dim filter As String = " 1 = 1 "
Dim Str1 As String
For m As Integer = 0 To txts.Length - 1
Dim txt As String = txts(m)
txt = "'%" & txt & "%'"
For i As Integer = 0 To cls.Length - 1
cls(i) = cls(i) & " Like " & txt
Next
Str1 = String.Join(" or ", cls)
txts(m) = "( " & str1 & ")"
Next
Dim Nf As String = String.Join(" and " , txts)
t.Filter = filter & " and " & nf