List:MySQL and .NET« Previous MessageNext Message »
From:nil18 Date:October 28 2004 9:49pm
Subject:Illegal mix of collations
View as plain text  
Hi!

I'm using the .NET Connector version 2, because i got a strange "read_only" error in
version 1. So i added the new dll to my directory and hoped that the old code will work
now.
But a new error occured.
I hope you can help me.
Here's the code:

private void Button1_Click(object sender, System.EventArgs e)
{	
   string x="'"+tb2.Text+"%'";
   string bla = "SELECT * from name where Name like "+x;
   string cs = "SERVER = localhost; DATABASE = gerrit; UID = root; PASSWORD=vikings;";
    MySql.Data.MySqlClient.MySqlConnection con = new
MySql.Data.MySqlClient.MySqlConnection(cs);
    MySql.Data.MySqlClient.MySqlCommand test = new
MySql.Data.MySqlClient.MySqlCommand(bla,con);
    con.Open();
    MySql.Data.MySqlClient.MySqlDataReader read = test.ExecuteReader(); // here is the
error
    while(read.Read())
    {
         string Name = (string) read["Name"];
          tb.Text = tb.Text + " " +Name+ "\n";
    }
    read.Close();
    read=null;
    con.Dispose();
    con.Close();
    con=null;
}

The error is following:

#HY000Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and
(utf8_general_ci,COERCIBLE) for operation 'like' 

Zeile 60: MySql.Data.MySqlClient.MySqlCommand test = new
MySql.Data.MySqlClient.MySqlCommand(bla,con);
Zeile 61: con.Open();
Zeile 62: MySql.Data.MySqlClient.MySqlDataReader read = test.ExecuteReader(); // here is
the error
Zeile 63: while(read.Read())
Zeile 64: {

I really hope you can help me!

Thank you very much.
Greetings from Austria
Gerrit

-------------------------------------------
Versendet durch AonWebmail (webmail.aon.at)
Thread
Illegal mix of collationsnil1828 Oct
  • RE: Illegal mix of collationsReggie Burnett14 Nov