Dataview RowFilter 转义无效字符
是否有人有一种方便的现成方法来转义通配符,字符串中的无效字符要分配给 C# 中 DataView
的 RowFilter
。规则有点像下面,
If a column name contains any of these special characters ~ ( ) # \ / = > < + - * % & | ^ ' "
[ ], you must enclose the column name within square brackets [ ]. If a column name contains
right bracket ] or backslash \, escape it with backslash (\] or \\).
谢谢:)
Does any one have a handy ready to use method to escape wildcards, invalid characters in the string to be assigned to RowFilter
for a DataView
in C#. The rules somewhat are like below
If a column name contains any of these special characters ~ ( ) # \ / = > < + - * % & | ^ ' "
[ ], you must enclose the column name within square brackets [ ]. If a column name contains
right bracket ] or backslash \, escape it with backslash (\] or \\).
thanks :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这将基于这里找到的更详细的规范来工作,
我把它扔掉了进入我正在查看的网页,因此忽略 Page_Load,当然可以根据需要进行测试。
希望有帮助。
This will work based on the specs outlined in a bit more detail found here
I tossed it into a web page I was looking at so disregard the Page_Load and of course test however you would like.
Hope that helps.