About Me

My photo

I'm an undergraduate of Rajarata University of Sri Lanka reading Applied sciences degree. I'm really interested in Java Programming language and developing some software using Java

Sunday, January 1, 2012

Connecting Visual Basic 2010 with MySql database

Hi guys,

I'm going to show you, how to connect VB 2010 with MySql database

1. You have to download WAMP SERVER 2.2A or other versions for your windows operating system. If you are using 64 bit OS you have to download 64 bit compatible version of  WAMP SERVER 2.2A.


You can download WAMP SERVER 2.2A for your OS in this link http://www.wampserver.com/en/



2. Install the WAMP SERVER 2.2A by running the downloaded file

3. Download mysql database connecter. You can get it from this link http://www.mysql.com/downloads/connector/net/

4 Run the downloaded connecter to attach it with VB 2010 Reference list

5 Open Visual Studio 2010 and create new windows application

6 In solution explorer window click Show All File button


7 Right click on References folder in the window shown above and select add references option

8 Select the Brows tab on showing Addreference window navigate to Programe Files (x86) by clicking the down arrow in Look in combo box

And You will be shown a folder called MySql


Double click the MySql Folder and go beyond by clicking until get Go to \MySQL Connector Net 6.4.4\Assemblies\v4.0 and you will be having a window like the one below shown

Double click on MySql.Data.dll and you will be getting to your Visual Studio main window from thetre click on Solution Explorer à  References à Addreference like the above process you will be having a window like the above one and choose the .NET tab in the shown window

9. In the shown window click on Component Name tab after that scroll the scroll bar until getting to the MySql.Data file

Double click on MySql.Data that’s it now you can make connection to your WAMP SERVER and can add data retrieve data

Tomorrow We will show  code in visual basic for adding and receiving data to MySql tables……




  Screen shot Demo is shown below....