如何将TextBox结果转换为Unicode字符? [英] How to convert TextBox result to Unicode characters?
问题描述
所以我有一个文本框,我必须将一些阿拉伯字符放入此文本框并保存到sqlserver,我的问题是当我保存更改的Sql Server它保存为?,我已经将列定义为在SqlServer中使用nvarchar,我使用Entity Framework来保存我的数据,我发现这个代码但是它使用了一个简单的Sql cmd:
将插入 [YourTableNameHere]值(N ' + yourValue + ')
我的代码是:
< pre lang =c#> Veh v = new Veh(); // 实体框架
VehEntities context = new VehEntities();
v.car = TxBoxCarNumber.Text; // 这里我添加了将结果转换为阿拉伯语的内容字母
context.Vehs.Add(v);
context.SaveChanges();
所以,如果您有任何想法,我将非常感激
参考这些链接...
http://forums.asp.net/t /1167422.aspx [ ^ ]
http://forums.asp.net/t/982003.aspx/1 [ ^ ]
>
您好,
您可以查看以下链接,它非常实用。
Google Translator [ ^ ]
尝试在您的应用程序中实现它。
-Anurag
>
so i have a text box that i have to put some Arabic characters into this text box and save it to sqlserver, my problem is when i saved changes in Sql Server it saved as "?", i already defined the column as nvarchar in SqlServer, and i use Entity Framework to save my data, i found this code but it use a simple Sql cmd:
insert into [YourTableNameHere] values(N'" + yourValue+ "')
my code is :
Veh v = new Veh();//Entity Framework
VehEntities context=new VehEntities();
v.car=TxBoxCarNumber.Text;//here which i have add something to convert the result to Arabic letters
context.Vehs.Add(v);
context.SaveChanges();
So if you have any idea i will be very appreciate
Refer these links...
http://forums.asp.net/t/1167422.aspx[^]
http://forums.asp.net/t/982003.aspx/1[^]
Hi,
You might wana check the below link, it is pretty useful.
Google Translator[^]
Try to implement it in your application.
-Anurag
这篇关于如何将TextBox结果转换为Unicode字符?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!