if insert the string by hand with MySqlWorkBench the result is correct
MySqlCommand cmdMySqlN = new MySqlCommand("", Connection); cmdMySqlN.CommandText = "INSERT INTO tb_Language (Text) VALUES (@text)"; ; try { myTrans = Connection.BeginTransaction(); Encoding utf8 = Encoding.UTF8; //Unicode string: string test = "abcéabc Colón à @ ç § "; byte[] utfBytes = utf8.GetBytes(test); //parameter for Blob cmdMySqlN.Parameters.AddWithValue("@text", utfBytes); cmdMySqlN.Transaction = myTrans; cmdMySqlN.ExecuteNonQuery(); myTrans.Commit(); } catch (Exception ex) { myTrans.Rollback(); string Message = "Error " + ex.Message; }
read with MySqlWorkBench and the result is <pre>abcéabc Colón à @ ç §
may be here the error byte[] utfBytes = utf8.GetBytes(testo);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)