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

I Would like to enter few UTF-8 Strings in MySql Database from ASP.Net front.

I just copy paste the findings from google.com/transliterate ((indic) Hindi version) to the textboxes and when I try to insert the textbox's UTF to Mysql it shows ???? in the Mysql Database. I tried debugging the code in VS 2005 and copied the insert string from the vs2005 to mysql. It again shown me ???? in the database (prepared string however was showing UTF Chars properly like this:

insert into news (NewsTitle,NewsDetails,NewsFooter) values ('उदाहरण','उदाहरण','उदाहरण')

generated by code behind:

"insert into news (NewsTitle,NewsDetails,NewsFooter) values ('" + t1.Text.ToString() + "','" + t2.Text.ToString() + "','" + t3.Text.ToString() + "')";

but when I use this string in mysql it shows ????

Strange is when I type the same string in MySql query browser and paste only the utf chars उदाहरण explicitly, It works fine and show the UTF chars.

:confused:

Can someone let me know what Asp.net string is generating wrong.

Thanks in advance.

Jay Khatri
Posted

1 solution

I got the answer,

Just edit the connectionstring and place Character Set=utf8;

Thats it.

Best Regards

Jay Khatri
 
Share this answer
 

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