.NET Connector and Unicode
Posted by:
Robert Sillett ()
Date: October 20, 2004 12:32PM
I am running MySQL 4.16 and the latest .NET connector. My table (and the database) have the default character set of utf8.
I am trying to insert Russian text into a table. What I am getting are question marks for each character, so my text looks like ????? ????? ?? ?????.
This is a snippet of what my code looks like in C#.
cmdMySql.CommandText = "INSERT INTO tblCommunity (Details) VALUES (?Details)";
MySqlParameter P = new MySqlParameter();
P.MySqlDbType = MySqlDbType.String; (I've also tried .VarChar)
P.ParameterName = "?Details";
P.Value = sRussianText;
cmdMySql.Parameters.Add(P);
cmdMySql.ExecuteNonQuery();
When I look at the contents of the string sRussianText in the C# debugger, I see the text in Russian. As soon as this code executes, the text becomes ????? ??? in the database.
I'm at a loss as to what's wrong. Any pointers would be greatly appreciated.
Thanks.
Bob
Sorry, you can't reply to this topic. It has been closed.
© 1995-2008 MySQL AB, 2008- Sun Microsystems, Inc.