数据库中的Unicode数据!! [英] Unicode data in Database!!

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

问题描述

大家好,

我们可以将unicode数据/区域性特定的文本存储到我的数据库中吗?

Can we store the unicode data / culture specific text into my database??

我正在为我的App使用VC#2005,并且我的数据库是一个.mdb文件.

I'm using VC# 2005 for my App and my database is a .mdb file.

我在印度印地语等本地语言中有一些字符串.现在...我可以将这些字符串值存储在数据库中吗?

I have some strings in local languale like Hindi, India. Now... can i store these string values in my database??

请提出任何相关的Web链接或一些代码示例!

Pls suggest any related weblinks or some code sample!

谢谢.

Soujanya

推荐答案

从Unicode到数据库的转换几乎是自动的.将存储Unicode的列必须为NCHAR或NVARCHAR,而不是CHAR和VARCHAR.如果进行此更改,则ADO.NET将处理其余的内容.请注意,切换到Unicode时,您将列的最大大小减少了一半,因为Unicode需要2个字节,而ANSI需要1-2个字节.

Conversion to and from Unicode into a DB is pretty much automatic.  The column(s) that will store Unicode need to be NCHAR or NVARCHAR rather than CHAR and VARCHAR.  If you make this change then ADO.NET will handle the rest.  Note that when switching to Unicode you are cutting the maximum size of the column in half because Unicode requires 2 bytes whereas ANSI requires 1-2.

Michael Taylor-2/14/07
http://p3net.mvps .org

Michael Taylor - 2/14/07
http://p3net.mvps.org


这篇关于数据库中的Unicode数据!!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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