怎么才能“假”呢? BindingSource 筛选器字符串中的通配符?
我知道您可以在过滤器字符串的末尾放置通配符(即“blah”,但我想知道如何使过滤器的行为就像字符串中间有通配符一样(即“ *bl*ah*') 哪个 DataColumn.Expression 属性不允许。我无法弄清楚模拟此行为的过滤器 (DataColumn.Expression) 的语法
'LIKE '*bl*' AND LIKE '*ah*'
是不够的,因为它会给我所有带有 'bl 的字符串。 ' 和 'ah',无论它们在字符串中的位置如何。
BindingSource.Filter = ??
I know you can put wildcards on the ends of a Filter string (i.e. 'blah', but I want to know how to make the filter behave like there are wildcards in the middle of the string (i.e. '*bl*ah*') which DataColumn.Expression property does not allow. I can't figure out the syntax for Filters (DataColumn.Expression) that would emulate this behavior?
'LIKE '*bl*' AND LIKE '*ah*'
is not sufficient because it will give me all strings with 'bl' and 'ah', regardless of their position in the string.
BindingSource.Filter = ??
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
很久以前就回答过这个问题,但我发现这是不合理的。这似乎就是与 BindingSource 过滤器进行模式匹配的本质。
Answering this from long ago, but I figured out that it cannot reasonably be done. It just appears to be the nature of pattern matching with BindingSource filters.