Monday, 7 March 2011

Connecting VB 2010 to a MySQL DB

MySQL databases are wildly used by individuals and large businesses, it's free, easy to use and pretty much brilliant.

You have to install both MySQL and the connector (needed to import different MySQL tools to vb)

This post will show you what version to download, and show you how to connect to it.


First of all download and install the latest version of MySQL
MySQL Server Download

Once installed and configured install the MySQL Connector/Net - ADO.Net driver
Connector/Net driver

During installation select the typical install


Now to connect Visual Basic to your MySQL database

On your new project click Project > Add Reference...


Click the .Net tab and select 'MySQL.Data'


Now click OK, congratulations you have connected VB and MySQL - in a sense

This now gives you the ability to connect to you MySQL database via VB.net and manipulate the database using commands created in VB - Which of course I shall show you in the not too distant future.


Further more..:
If you would like to see a list of the commands available after adding the reference click the following in VS


Following this open the references folder and then double click 'MySQL.Data'

7 comments:

  1. I'll look into trying this, thanks for the advice!

    ReplyDelete
  2. thanks much for the info bro!

    ReplyDelete
  3. Very helpful, I can put this to use on my friends site, thanks!

    ReplyDelete
  4. sr...thank u very much for this...

    ReplyDelete