以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  [求助]文本精确筛选  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=142627)

--  作者:manyifuwu
--  发布时间:2019/11/1 16:30:00
--  [求助]文本精确筛选

一下代码可以实现模糊查询,我想实现精确查询,怎么修改呢?

Dim Filter As String

Dim cmb As String

cmb = e.Form. Controls("TextBox2").text
\'If e.Form. Controls("查询").Value Is Nothing
\'\'Messagebox.show("请输入起始日期!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
\'Return
\'End If
Dim txt As String = e.Form.Controls("TextBox2").Text
Dim dt1 As DataTable = DataTables("单次来电_Table1")
If txt > "" Then
    txt = "\'%" & txt & "%\'"
    txt =  "编号 Like " & txt
       
End If

dt1.LoadFilter = txt
dt1.Load
Tables("单次来电_Table1").Sort = "录入时间 DESC"


--  作者:manyifuwu
--  发布时间:2019/11/1 16:57:00
--  
txt = "\'%" & txt & "%\'"
    txt =  "编号 Like " & txt
        不知道怎么改????能实现精确筛选编号     ??  谢谢!!
--  作者:有点蓝
--  发布时间:2019/11/1 17:35:00
--  

Dim txt As String = e.Form.Controls("TextBox2").Text
Dim dt1 As DataTable = DataTables("单次来电_Table1")

dt1.LoadFilter ="编号 = \'" & txt & "\'"
dt1.Load