Unicode(缅甸)字符的DataTable.Select方法问题

编程入门 行业动态 更新时间:2024-10-10 13:13:10
本文介绍了Unicode(缅甸)字符的DataTable.Select方法问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

你好! 在Asp.Net中搜索Unicode字符时,DataTable的选择方法出现问题. DataTable.Select()无法使用Unicode字符.这是我的代码........

Hello! I have a problem with Select Method of DataTable when search Unicode Characters in Asp.Net. DataTable.Select() can''t work with Unicode Characters. And Here is My Code........

DataRow[] dr = dt.Select("Name LIKE '%" + txtSearch.Text + "%'");

dt是DataTable,而txtSearch.Text包含Unicode字符.

dt is DataTable and txtSearch.Text Contains Unicode Characters. How can I search Unicode Characters?

推荐答案

如果使用.NET 3.5 或更高版本,那么我认为LINQ 是更好的选择,因为Culture aware比较可以用LINQ 制成以从DataTable获取所需的行. 如果要使用.NET 2.0,则将使用DataTable.Select方法,并且DataTable.Select方法不具有文化意识,如此处报道 DataTable.Select()方法不支持文化 [ ^ ] 在此给出了解决此问题的方法 DataTable的字符串比较问题 [ ^ ] 请参见.可能会有所帮助. If .NET 3.5 or above is used then I think LINQ can be a better alternative as Culture aware comparison can be made with LINQ to get the desired rows from the DataTable. If .NET 2.0 is to be used then DataTable.Select method is to be used and the DataTable.Select method is not culture aware as reported here DataTable.Select() method is not culture-aware[^] A work around for this issue is given here Problem on DataTable''s string comparison [^] Please see. It may be helpful.

更多推荐

Unicode(缅甸)字符的DataTable.Select方法问题

本文发布于:2023-11-11 05:21:15,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1577490.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:缅甸   字符   方法   Unicode   Select

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!