汉字在SQL数据库中被写为问号. [英] Chinese character are written as question marks in the SQL database.

查看:460
本文介绍了汉字在SQL数据库中被写为问号.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用ADO .net将字符串写入Microsoft SQL Server 2005数据库表中的字段.
我正在使用SqlBulkCopy :: WriteToServer api写入SQL数据库.
Sql数据库表中列的数据类型为varchar2.如果我将数据类型更改为nvarchar,则汉字书写正确.但是我认为它也应该与数据类型varchar2一起使用.
请帮忙.
预先感谢.

I am using ADO .net to write a string to a field in a table of Microsoft SQL Server 2005 database.
I am using SqlBulkCopy::WriteToServer api to write to SQL database.
The data type of the column in Sql database table is of type varchar2. If I change the datatype to nvarchar the chinese characters are written properly. But I think it should work with data type varchar2 also.
Please help.
Thanks in advance.

推荐答案

否,nvarchar支持Unicode,而varchar不支持.
您只需要使用nvarchar来支持汉字.
No, nvarchar supports Unicode, while varchar doesn''t.
You have to use nvarchar only for chinese character support.


这篇关于汉字在SQL数据库中被写为问号.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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