开发者

How to save and retrieve foregin language(Malayalam ) datas in sql server 2008

I want to save Malayalam language datas in sql server 2008.I have installed Malayalam font in system and in my application 开发者_如何转开发i changed TextBox font into Malayalam. So it displayed in malayalam but actually its English letters.If am saving into database it stored in English,But i want to save TextBox value in Malayalam to database .

Please Help.


Use nvarchar datatype in the tables which will store unicode data.

Make sure that your database calls also use nvarchar.


I just followed my own style of coding. so please consider this when you follow me.

First I created the MySql database.

after creating database, in mysql command prompt, give the command:

SET NAMES = UTF8;

table and columns to store unicode are to be set with collation property as utf8-utf_general_ci. Each and every column which meant to store unicode, is to be selected and set collation property to utf8-utf_general_ci.

Now in C#.

my connection string is set as usual but with addition of a single attribute like this:

constring = @"SERVER=localhost;" + @"PORT=3306;" + @"DATABASE=gayakidb;" + @"UID=root;" + @"PASSWORD=mysql;" + @"charset=utf8;";

Next, installed unicode font in the 'Display language setting' of your system OS. Or, you can copy and paste the font file (true type file) in the Fonts folder of Operating System.

Then I set the font property of the textbox object or any other tool object in property page.

More over, if you need to type in unicode font using your keyboard, you need to install the unicode language for keyboard layout. That could be done using the option for regional language settings of your Operating System.

Done. with these settings, i coded module for saving data and while running the ocde, it successfully done the work.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜