YIPES! Insert into TEXT column fails when using UTF-8 encoding
Posted: Fri 13 May 2005 20:02
Using MySQL Direct 2.80.5.0
MySQL 4.1.11-nt via TCP/IP
Table defined:
testID int NOT NULL - autoincrement
textfield text NOT NULL - utf8
The following code successfully runs, but fails to store anything after the first special character (Ñ):
MySQL 4.1.11-nt via TCP/IP
Table defined:
testID int NOT NULL - autoincrement
textfield text NOT NULL - utf8
The following code successfully runs, but fails to store anything after the first special character (Ñ):
Code: Select all
CoreLab.MySql.MySqlConnection conn = new MySqlConnection(connectionstring);
conn.Open();
string s = "UNA PEQUEÑA CONTRIBUCION";
using (MySqlCommand cmd = conn.CreateCommand())
{
cmd.CommandType = CommandType.Text;
cmd.CommandText = "insert into test (textfield) values (@textfield)";
cmd.Parameters.Add("@textfield", s);
cmd.ExecuteNonQuery();
}
conn.Close();
conn.Dispose();