I have next code that fails with "Incorrect string value" error.
My column character set is latin1, and character that is failing is '°C' degree (which is in latin1 character set).
Same code using MySql.Data v8.0.28.0 is working.
static public bool AddResults(string testId, string xml)
{
var conn = new Devart.Data.MySql.MySqlConnection("Server=localhost;Database=db;Uid=root;Pwd=root;");
try
{
conn.Open();
var sql = $"INSERT INTO resultpools (TestID, Pool) VALUES (@TestID, @Pool)";
var cmd = new Devart.Data.MySql.MySqlCommand(sql, conn);
cmd.Parameters.AddWithValue("@TestID", testId);
cmd.Parameters.AddWithValue("@Pool", xml);
return cmd.ExecuteNonQuery() > 0;
}
finally
{
conn.Close();
}
}
"Incorrect string value" error
Re: "Incorrect string value" error
Set "Unicode=True;" in the connection string.
https://www.devart.com/dotconnect/mysql ... tring.html
Unicode: Sets client charset to utf8mb4 for MySQL 5.5.3 and higher or to utf8 for MySQL versions lower than 5.5.3 and converts client data according to this charset.
https://www.devart.com/dotconnect/mysql ... tring.html
Unicode: Sets client charset to utf8mb4 for MySQL 5.5.3 and higher or to utf8 for MySQL versions lower than 5.5.3 and converts client data according to this charset.