MySQL inserting UnicodeStr
-
Hi All, I have a unicode string string tempstr = "פסטיבל סגול ה- 11 - למדיטציה ואהבה"; odbcCmd.Text = "update myTable set testField '" + tempstr + "' where myIndex=3"; odbcCmd.ExecuteNonQuery(); After I run ExecuteNonQuery(), I found '???????' in the testField instead of Hebrew chars. I also tested out with languages other than English, it is inserting '????' instaead of unicode string. However, I run that Update string in the mySQL browser (not using any program), it inserted info/nicode string correctly. Why is it? I look at the field properties and it was set to utf8. how can I insert non-english characters ino db please. Thank You.
-
Hi All, I have a unicode string string tempstr = "פסטיבל סגול ה- 11 - למדיטציה ואהבה"; odbcCmd.Text = "update myTable set testField '" + tempstr + "' where myIndex=3"; odbcCmd.ExecuteNonQuery(); After I run ExecuteNonQuery(), I found '???????' in the testField instead of Hebrew chars. I also tested out with languages other than English, it is inserting '????' instaead of unicode string. However, I run that Update string in the mySQL browser (not using any program), it inserted info/nicode string correctly. Why is it? I look at the field properties and it was set to utf8. how can I insert non-english characters ino db please. Thank You.
Have a look at this: Mysql Unicode[^]
#region signature my articles #endregion
-
Have a look at this: Mysql Unicode[^]
#region signature my articles #endregion
Thank You Giorgi, I looked at the link you gave it to me and I tried it. My TableOptions are following: MyISAM Storage Engine, Charset=utf8, Collation= Utf8_general_ci I tried with following two myConnection strings 1) cnnString = "DRIVER={MySQL ODBC 3.51 Driver};SERVER=imagingsql01;UID=roscoe; PASSWORD=roscoe;OPTION=3; Data Source=localhost; Persist Security Info=yes;character set=utf8;Database=myDBName;";//CHARSET=utf8;"; 2) cnnString = "DRIVER={MySQL ODBC 3.51 Driver};SERVER=imagingsql01;UID=roscoe; PASSWORD=roscoe; OPTION=3; Data Source=localhost; Persist Security Info=yes;CHARSET=utf8;Database=myDBName;"; I tried both ways and still inserting '??????' to the table. What else do I need to do to the table/code so the inserting can be done in proper way. Thanks.
-
Thank You Giorgi, I looked at the link you gave it to me and I tried it. My TableOptions are following: MyISAM Storage Engine, Charset=utf8, Collation= Utf8_general_ci I tried with following two myConnection strings 1) cnnString = "DRIVER={MySQL ODBC 3.51 Driver};SERVER=imagingsql01;UID=roscoe; PASSWORD=roscoe;OPTION=3; Data Source=localhost; Persist Security Info=yes;character set=utf8;Database=myDBName;";//CHARSET=utf8;"; 2) cnnString = "DRIVER={MySQL ODBC 3.51 Driver};SERVER=imagingsql01;UID=roscoe; PASSWORD=roscoe; OPTION=3; Data Source=localhost; Persist Security Info=yes;CHARSET=utf8;Database=myDBName;"; I tried both ways and still inserting '??????' to the table. What else do I need to do to the table/code so the inserting can be done in proper way. Thanks.
Which driver are you using to connect to Mysql? Also, check this link: http://dev.mysql.com/doc/refman/5.0/en/faqs-cjk.html[^]
#region signature my articles #endregion
-
Which driver are you using to connect to Mysql? Also, check this link: http://dev.mysql.com/doc/refman/5.0/en/faqs-cjk.html[^]
#region signature my articles #endregion