Click here to Skip to main content
15,895,011 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello, I have a problem, i`m trying to make an application that connects to my mysql db, but i get an error-Backend sent unrecognized response type: 8
How to solve this? Error pops up on connection.Open line.

Here the code
-
NpgsqlConnection conection = new NpgsqlConnection("Server=xxx;Port=3306;Database=xxx;User Id=xxx;Password=xxx;");

NpgsqlDataAdapter npgsqldataadapteris1 = new NpgsqlDataAdapter();
conection.Open();

Npgsql.NpgsqlCommand komanda = new NpgsqlCommand("INSERT INTO tournaments(majaskomanda,viesukomanda,mgoli, vgoli) VALUES(@mvalsts,@vvalsts,@mgoli,@vgoli)", conection);
//komanda.Parameters.AddWithValue("match_id", comboBox2.Text);
komanda.Parameters.AddWithValue("mvalsts", richTextBox1);
komanda.Parameters.AddWithValue("vvalsts", richTextBox1);
komanda.Parameters.AddWithValue("mgoli", richTextBox1);
komanda.Parameters.AddWithValue("vgoli", richTextBox1);

komanda.ExecuteScalar();
conection.Close();
} 
Posted
Comments
CHill60 28-May-13 6:18am    
Do you get the same problem if you don't specify the port number?

You are using a postgres connector[^] to connect to a MySQL database.

MySql Connector downloads.[^] is the connector that you need to use with MySql
 
Share this answer
 
Hello,

NpgsqlConnection Class represents a connection to a PostgreSQL server. Why are you using it to connect to MySQL. You should be using ADO.NET Driver for MySQL (Connector/NET) available here.

Regards
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900