Connect to Mysql from a Windows Application using ODBC

1. Download the mysql connector located here : 

 2. Add a reference to the  (for some reason is missing from the .net  reference tab). If that is the case for you downlaod the "Windows Binaries, no installer (ZIP)" version and click on the browse tab and locate the the manually.

3. Add the using MySql.Data.MySqlClient to your project.

4.  Create your connection MyConnection.ConnectionString = @"SERVER=" + dbHost.text + ";" + DATABASE=" + Database.text + ";" + "UID=" + dbUsernme.text + ";" + "PASSWORD=" + dbPassword.text + ";";

5. Then Test it.

Let's share thisShare on Facebook
Tweet about this on Twitter
Share on LinkedIn