以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- [求助]filter条件该怎么设置? (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=77112) |
-- 作者:浙江仔 -- 发布时间:2015/11/11 11:14:00 -- [求助]filter条件该怎么设置? Dim txt As String = e.form.Controls("TextBox10").text Dim tbl As DataTable = DataTables("Person_info") If txt = "" Then \'tbl.Filter = "" Else tbl.loadFilter = "[name] like \'" & txt & "\' " tbl.load() End If 以上只能完全匹配加载,怎么该模糊匹配? 以下能模糊筛选: Dim tbl As Table = Tables("Person_info") If txt = "" Then \'tbl.Filter = "" Else txt = "\'*" & txt & "*\'" tbl.Filter = "name Like " & txt & " Or papernum Like " & txt & " Or phone Like " & txt & " Or bmunit Like " & txt End If |
-- 作者:大红袍 -- 发布时间:2015/11/11 11:22:00 -- Dim txt As String = e.form.Controls("TextBox10").text
Dim tbl As DataTable = DataTables("Person_info")
If txt = "" Then
tbl.loadFilter = ""
Else
tbl.loadFilter = "[name] like \'%" & txt & "%\' "
End If
tbl.load()
|
-- 作者:浙江仔 -- 发布时间:2015/11/11 11:26:00 -- 谢谢,搞半天实在没办法了 |