Click here to Skip to main content
15,868,236 members

Response to: MySql and C# and arabic

Revision 2
i might be late with this reply but i am posting this for future reference to other users
i also been looking for a way to insert arabic language into the MySQL database
so far i have been able to get the following solution to run properly on VB .net
currently i am using the MySQL connector .Net 6.4.4

first i have set my default collation for my database to cp1256 - default as windows uses this for arabic (according to this link[^])

then on the connection string put the CharSet to cp1256 similar to this
AccessData = New MySqlConnection("Server = xxx;Database = xxx;Uid = xxx;Pwd = xxx;CharSet=cp1256;")

now i just did a normal insert command with arabic letter and things worked OK
SQL = "INSERT INTO tbl1 (enVal, ArVal) VALUES ("test","arabic_characters");"

hope these information help
Posted 8-Jul-12 9:47am by opden.
Tags: ,