SqlConnection
is for SQL Server. You need MySqlConnection
– this is not part of the .NET Framework, so you will have to download it and reference it in your project. You can then create a MySqlConnection
object and connect to MySQL in your application:
MySqlConnection connection = new MySqlConnection(myConnString);
You will also have to use the MySqlCommand
object rather than the SqlCommand
object.
http://dev.mysql.com/doc/refman/5.0/es/connector-net-examples-mysqlconnection.html