Click here to Skip to main content
15,891,943 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi friends

Im in a trouble with unicode , vb.net , and mysql

Im trying to save some indic (Indian) language data in unicode ,

And the mySQL table structure is some thing like

<br />
create table names_collection<br />
(<br />
name_en varchar(50),<br />
name_il varchar(150) charset 'utf8'<br />
)<br />



when i try to insert the data , using a mysql procedure , and mysql connectors mysqlcommand, its inserting data but when I fill it in datagridview using dataset and selectting the universal unicode font
Arial Unicode MS , Im geting some junk chars in unicode filed

Could any any one ,help me with some sample code , for unicode/vb/mysql combination

regards
john
Posted

I thought nvarchar was unicode ? VB strings are all unicode. Why use UTF8, mightn't that just confuse things ?
 
Share this answer
 
Christian is correct - change the datatype of your fields to nVarChar(50) and nVarChar(150) respectively.

Drop the charset 'utf8' stuff.
 
Share this answer
 
Append ;charset=utf8 to connection string
all is going to be fine


regards
john
 
Share this answer
 
v2
I think so. Please change your datatype in your database as seeing in solution 2
 
Share this answer
 
In connection string add this
character set=utf8;

Thank You
 
Share this answer
 
Comments
[no name] 15-Oct-12 20:08pm    
Congratulations! The question was answered over a year ago and all you had to do is copy the accepted solution. Well done.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900