以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  like怎么加?  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=187742)

--  作者:cyrollin
--  发布时间:2023/8/8 15:15:00
--  like怎么加?
For Each fwry As String In DataTables("列表数据").GetValues("第二列", "第二列 not in (\'" & e.Row("姓名").Replace(",", "\',\'") & "\')")

 请问,在上面这句中,把类似姓名的不显示出来,like 怎么加?

for example:

For Each fwry As String In DataTables("列表数据").GetValues("第二列", "第二列 not like in (\'" & e.Row("姓名").Replace(",", "\',\'") & "\')")
or
For Each fwry As String In DataTables("列表数据").GetValues("第二列", "第二列 not in (\'" & like e.Row("姓名").Replace(",", "\',\'") & "\')")

 


--  作者:有点蓝
--  发布时间:2023/8/8 15:18:00
--  
dim s as string = "1=1"
for each s1 as string in e.Row("姓名").split(",")
s = s & " and 第二列 not like \'%" & s1 & "%\'"
next
msgbox(s)
For Each fwry As String In DataTables("列表数据").GetValues("第二列", s)

--  作者:cyrollin
--  发布时间:2023/8/8 16:25:00
--  
好的,谢谢 ,自己修改了一下,出现了错误,请帮我看看,谢谢 。

详细错误信息:
Exception has been thrown by the target of an invocation.
Syntax error: Missing operand before \'Mod\' operator.

    Dim sd As String = "1=1"
     For Each s1 As String In e.Row("姓名").split(",")
     sd = sd & " and 第二列 like \'%" & s1 & "%\'"
     Next
        For Each fwry As String In DataTables("列表数据").GetValues("第二列", "第二列 not in (\'" & sd & "\')")

--  作者:有点蓝
--  发布时间:2023/8/8 16:36:00
--  
For Each fwry As String In DataTables("列表数据").GetValues("第二列", sd )