使用正确的语言从SQL Server到C#的Diaplay数据 [英] Diaplay data from sql server to c# with the correct language

查看:97
本文介绍了使用正确的语言从SQL Server到C#的Diaplay数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿,我正在做一些C#项目,我打算这样做来存储本地语言,并且确实存储在SQL Server中,但是当我在数据库中看到它时,它会像"????"那样保存.标记,当我显示它时,它会显示您的问号符号,但输入的语言是正确的本地语言,我的问题确实是如何存储确切的语言而不是问号,以及如何显示它.


Tnx

hey i was doing some C# project and i planed to do it to store local language and i really store in SQL server but when i see it in the database it is saved like "????" mark and when i display it it display thee question mark sign but the input is the correct local language and my question really is how to store the exact language instead of the question mark and also how to display it.


Tnx

推荐答案

您需要对字符串使用nvarchar数据类型
http://msdn.microsoft.com/en-us/library/ms186939.aspx
并且您还需要在所有unicode字符串之前加上N http://support.microsoft.com/kb/239530


希望有帮助
You need to use nvarchar data type for strings
http://msdn.microsoft.com/en-us/library/ms186939.aspx
and you also need to precede all unicode strings with N http://support.microsoft.com/kb/239530


Hope this help


这篇关于使用正确的语言从SQL Server到C#的Diaplay数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆