Once you know it, it's simple:
- The varchar column Charset should be utf8
- The varchar column Collate property should be utf8_general_ci. I tried utf8_bin and worked too. This is a screen shot from MySQL Administrator table editor:
- In the .net application, the connection string must include charset=utf8. For example:
"server=localhost;uid=root;password=123;database=test;port=3306;charset=utf8"
9 comments:
thanks it was helpfull for me
Thanks 1000 times, i was searching for this solution for the whole day.
that is what i called professional developer.
it works man
thanks (Y)
Hi,
I am trying to save hindi words to mySQL using ASP.Net and also want to display it. I dont know how it is possible. As you said in your post, I have created a database and a field with utf8 as you mentioned. Then I just copy a hindi word and paste it into a textbox in asp.net. Then I save this field into above field in the mySQL. When I go to database it is seen as ||||||. Can you give me a help for saving and display hindi words using asp.net and mySQL.
It didn't work with me at all... I could store Arabic characters in the MySQL field but I couldnt read/write Arabic in the MySQL database from my ASP.Net files.
I've been trying for severals days finding a solution for this problems. I tried using PHP and it works perfectly... I can read/write Arabic characters in/from MySQL database. However with ASP.Net I can't get it work!
Microsoft SQL is much more easier to read/write Arabic (and Hindi and other)characters in ASP.Net, by assigning the NVARCHAR data type.
So I'd recommend Ansar to store your information on MS SQL instead of MySQL for ASP.Net application.
Thanks, for the post , it really worked appending the database connection string with charset=utf8 and changing the mysql db schema to utf8 charset.
Thank you, it was helpfull for me
Many thanks. it's solve my issue.
Post a Comment