Quantcast
Channel: MySQL Forums - Connector/NET and C#, Mono, .Net
Viewing all articles
Browse latest Browse all 1451

MySql Big5-HKSCS problem (no replies)

$
0
0
Hi all,
I am using ADO.net with mysql connector
I have created a table in database using InnoDB with the collation of utf8_general_ci
The version of the MySql is 5.5.24.


The following is the DDL of the table

delimiter $$

CREATE TABLE `testing` (
`Id` varchar(50) CHARACTER SET utf8 NOT NULL,
`Value` varchar(45) CHARACTER SET utf8 NOT NULL,
PRIMARY KEY (`Id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci$$



Then, I created a winform with a textbox for user to input text.
I found that if there is any HKSCS in the textbox, mysql will throw exception and said that the field cannot be null.


The following is my insert statement (I am using prepare statement)
insert into Testing (Id, Value) values (?id, ?value)

and I pass the parameter using MySqlParamter.
com.Parameters.Add(new MySqlParameter("?id", Guid.NewGuid().ToString()));
com.Parameters.Add(new MySqlParameter("?value", value));

When I use debugger to inspect the value, it should not be null and it has the value of user input. however, mysql throw the exception that the value is null.

The testing input text that I used is "梁四𠰠"


Does anyone know how to solve the problem?

Viewing all articles
Browse latest Browse all 1451

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>