As i started with my new project. I choose vb.net 2005 and PHP to write my Frontend applications and MySQL for my Backend. There is no problem connecting my PHP program to a MySQL database… The problem is how can I connect my VB.net program to a MySQL database??? Connecting a VB.net program to a Microsoft SQL Server and to a Oracle is a walk in the park. After a couple of Googling and some sweat & blood hehehe… I come up with this solutions…..
First download and install a MySQL Connector for .NET here
Then in VB.NET IDE go to Project > Add Reference… In the .NET Tab Add the MySQL.Data Reference and click OK
Use this code to Open a Database Connection:
Public Conn As MySqlConnection
Conn = New MySqlConnection()
Conn.ConnectionString = “server=localhost; Port=3306; user id=USER; password=PASSWORD; database=MyDatabase”