Bug #7785 Solved
Submitted: 10 Jan 2005 22:35 Modified: 31 Jan 2005 21:20
Reporter: Jordi Bruña Email Updates:
Status: Not a Bug Impact on me:
None 
Category:Connector / NET Severity:S3 (Non-critical)
Version:1.0.3.31712 OS:.Net 1.1
Assigned to: Reggie Burnett CPU Architecture:Any

[10 Jan 2005 22:35] Jordi Bruña
Description:
I update a datatable with the mysqldataadapter. The insert, update and delete command whas create with the mysqlcomandbuilder. The select statement whas a select * from [table].
When i update the datatable i use the delegate MySqlRowUpdatedEventHandler to know if there are any error in the update. The datarows which has a column text which it has a text to update that has the "/" caracter seems fails. It has the update status haserrors.
the column is unicode and i using the innodb engine. the mysql version is 4.1.3b

How to repeat:
Create a datatable whith a unicode text column. 
Create the commands whith the comandbuilder and save in a struct o class.
Create a new datarow.
Insert in the column a text with a "/" caracter
update the datatable whith a adapter and use the command that was created with the commandbuilder.
Implements the delegate MySqlRowUpdatedEventHandler  in the dataadapter to knows if there was any error.
[11 Jan 2005 14:56] Jordi Bruña
the problems ocurred when the dataadapter try update or insert a column which in the database has a national character. Example when a text column has a character as á or é or the ¿ character. I'm using spanish characters.
An example. I has a row what has a text column with this data: 
llamara mañana.
if the ñ character is in the word the row update fails. 
if i change the ñ character to the a ny the update is correct.
I don't understand whats the problem and i don't have the knowledge to debug de driver.
Please help
[11 Jan 2005 15:30] Jordi Bruña
there isn't any error in the driver. I didn't know that i need to set the characterset to utf8 in the connection string. 
Thanks a lot. 
Excuse me.
[30 Aug 2005 14:46] Rok Bermež
Setting the CharSet wont work for me. The following code snippet will always insert 'aa-Cc????-bb' into database. I cant seem to find the problem. Any help would be greatly appreciated.

MySqlConnection ConnNew = new MySqlConnection("Database=zaposlitev;Data Source=10.0.10.20;User Id=user;Password=pass;CharSet=utf8;");
ConnNew.Open();
string sSql="INSERT INTO tmp (tmp) VALUES (?tmp);";
MySqlCommand cmd = new MySqlCommand(sSql,ConnNew);
cmd.Parameters.Add( "?tmp", "aa-Č芚Žž-bb");
cmd.Prepare();
cmd.ExecuteNonQuery();
ConnNew.Close();

Interestingly if I just use:
MySqlConnection ConnNew = new MySqlConnection("Database=zaposlitev;Data Source=10.0.10.20;User Id=ata;Password=ata;CharSet=utf8;");
ConnNew.Open();
string sSql="INSERT INTO tmp (tmp) VALUES ('aa-Č芚Žž-bb');";
MySqlCommand cmd = new MySqlCommand(sSql,ConnNew);
cmd.ExecuteNonQuery();
ConnNew.Close()

Everything is inserted fine.

PLEASE HELP!!!
[30 Aug 2005 16:16] Reggie Burnett
Rok

What version of the connector are you using?  1.0.4 or 1.0.5?
[31 Aug 2005 8:00] Rok Bermež
I was using 1.0.4. and thought it was the latest. 1.0.5. solved the problem. THANK you so much Reggie!!!!