以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- 搜索带通配符,会出现错误 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=91135) |
-- 作者:szsmall -- 发布时间:2016/9/30 10:21:00 -- 搜索带通配符,会出现错误 搜索输入“500*200”出现错误,只输入“500*”没问题 代码如下: Dim t1 As WinForm.Table = e.Form.Controls("Table1") Dim ids As List(Of String) = t1.Table.DataTable.GetValues("计划单号",t1.Table.Filter) Dim t2 As WinForm.Table = e.Form.Controls("Table2") Dim filter As String = "计划单号 in (\'" & String.Join("\',\'",ids.ToArray()) & "\') " Dim txt As WinForm.TextBox = e.Form.Controls("TextBox1") If txt.Text > "" Then filter = filter & " and 材料名称 like \'%" & txt.Text & "%\' or 规格型号 Like \'*" & txt.text & "*\' Or Convert([数量],\'System.String\') like \'%" & txt.text & "%\' " t2.Table.Filter = filter End If |
-- 作者:有点蓝 -- 发布时间:2016/9/30 10:33:00 -- If txt.Text > "" Then txt.Text = txt.Text.replace("*","[*]") filter = filter & " and 材料名称 like \'%" & txt.Text & "%\' or 规格型号 Like \'*" & txt.text & "*\' Or Convert([数量],\'System.String\') like \'%" & txt.text & "%\' " t2.Table.Filter = filter End If |
-- 作者:szsmall -- 发布时间:2016/9/30 12:04:00 -- 想看一下ids、filter的内容,用MessageBox,但出现错误?
此主题相关图片如下:msgbox 想看数组 错误.jpg |
-- 作者:有点蓝 -- 发布时间:2016/9/30 14:15:00 -- 循环输出 Dim Lst As New List(Of String)
Lst.Add( "电视机") Lst.Add("电冰箱") Lst.Add("洗衣机") Lst.Remove("电视机") For Each nm As String In lst Output.Show(nm) Next |