如何使用C#将Unicode保存到SQL Server [英] How to Save Unicode To Sql server Using C#
本文介绍了如何使用C#将Unicode保存到SQL Server的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想将Unicode上传到Sql Server并检索上传的数据
如何做到这一点..?
I Want To Upload Unicode To Sql Server and Retrieve Uploaded Data
how to do this.. ?
推荐答案
请参阅 - < a href =http://msdn.microsoft.com/en-us/library/ms180059.aspx> UNICODE(Transact-SQL) [ ^ ]
干杯,>
Edo
See - UNICODE (Transact-SQL) [^]
Cheers,
Edo
您需要将列设置为nvarchar
并在将值插入列之前使用N ''
eg
You need to set the column as nvarchar
and before inserting the value to column use N''
eg
update dbo.Supplier
SET FirstNameLocalLang=N'英商'
WHERE Supplier_id=30052810
INSERT INTO supplier VALUES (N'汉字/漢字'')
无需更改C#代码,也无需进行任何操作。保持常用的选择查询
No changes required in C# code and while selecting no need to do anything. Keep the usual select query
您需要将目标表字段定义为nvarchar,并使用ADO连接加载数据,就像任何其他数据一样。
You need to define your target table fields as nvarchar and load you data using an ADO connection just like any other data.
这篇关于如何使用C#将Unicode保存到SQL Server的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文