How to select the data by unicode where condition?

大兔子大兔子 提交于 2020-01-04 13:05:54

问题


I would like to get the data base on following SQL Statement and that was located in TableAdapter.

SELECT * FROM Student WHERE Chinese_Name = @Param

Example code call from C# is like this.

GetDataByChinese_Name('你好');

But I have no idea where should I put the N prefix in that syntax. Usually, we can get

SELECT * FROM Student WHERE Chinese_Name = N'你好'

this way.


回答1:


Your c# code should be slightly different. Use verbatim string literal.(msdn)

    GetDataByChinese_Name(@"你好");


来源:https://stackoverflow.com/questions/15333226/how-to-select-the-data-by-unicode-where-condition

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!