C# web service, MySql encoding problem
- by Boban
I use C# web service to insert, delete and get data from MySql database.
The problem is some of the data is in Macedonian (Cyrilic).
When I insert directly in the database, it inserts ok. For example: "???" is "???".
When I insert throgh the service, it's not. For example: "???" is "???".
When I try to get data throug the service, it gets it ok.
What's the problem with the inserting?
Here is part of my code for inserting:
MySqlConnection connection = new MySqlConnection(MyConString);
MySqlCommand command = connection.CreateCommand();
command.CommandText = "INSERT INTO user (id_user, name VALUES (NULL, ?name);";
command.Parameters.Add("?name", MySqlDbType.VarChar).Value = name;
connection.Open();
command.ExecuteReader();
connection.Close();
return thisrow;
Tnq U in advance!!!