Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: MySQL VB.NET
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
 

create table names_collection
(
name_en varchar(50),
name_il varchar(150) charset 'utf8'
)

 

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 28-Jan-10 18:06pm
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

I thought nvarchar was unicode ? VB strings are all unicode. Why use UTF8, mightn't that just confuse things ?
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Christian is correct - change the datatype of your fields to nVarChar(50) and nVarChar(150) respectively.
 
Drop the charset 'utf8' stuff.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

Append ;charset=utf8 to connection string
all is going to be fine
 

regards
john
  Permalink  
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 4

I think so. Please change your datatype in your database as seeing in solution 2
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 5

In connection string add this
character set=utf8;
 
Thank You
  Permalink  
Comments
Wes Aday at 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)



Advertise | Privacy | Mobile
Web03 | 2.8.150302.1 | Last Updated 15 Oct 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100