Follow this process:
- Download Connector/Net 5.2.
- Unzip the binaries. You will find 3-4 dlls along with other files.
- Add reference to mysql.data.dll, in your project.
- You can connect to MySQL throw code, as described below:
String conString = “server=server_name; user id=user_name;
password=password; database=db_name; pooling=false;”;
String queryString = “select * from employee;”;
using (MySqlConnection mySqlConnection = new MySqlConnection(conString))
using (MySqlDataAdapter adapter = new MySqlDataAdapter(queryString, mySqlConnection))
DataTable dt = new DataTable();
dataGridView1.DataSource = dt;