I am using MySqlConnection in my .net application to query a MySql Database from a .net application, but special characters (it is in Danish) in my resultset is shown as question marks. I have tried including "charset" (charset=utf8) in my connection string without any luck.
Asked
Active
Viewed 109 times
1 Answers
0
try connection with
Server=localhost;Port=3306;Database=xxx;Uid=x xx;Pwd=xxxx;CHARSET=latin1;
And then
partial void OnContextCreated()
{
System.Data.Common.DbCommand command = this.Connection.CreateCommand();
command.CommandText = "set collation_connection = utf8_slovenian_ci;";
command.CommandType = System.Data.CommandType.Text;
this.Connection.Open();
command.ExecuteNonQuery();
}
like described here Database connection string and collation

nbk
- 45,398
- 8
- 30
- 47