I don't know if this has been made before, I did a search and couldn't find it, so here's a quick tutorial.
To be able to connect to mysql you need to install whats called a MySql Connector.
Download below
Get Things Ready
First install the program, It just takes a few seconds.
After installation open up VB 2008 and follow these steps.
1. Go to Project > Add Reference
2. Click .NET Tab and search for MySQL.Data and Add it
3. Go into the code view and above the "Public Class" type
"Imports MySql.Data"
And your set to create a connection.
Set Up A Simple Connection
Code:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim connect As MySqlConnection = New MySqlConnection("server=YOUR HOSTING SERVER;database=YOUR DATABASE NAME;uid=YOUR USERNAME;password=YOUR PASSWORD;")
Try
connect.Open()
If connect.State = ConnectionState.Open Then
MessageBox.Show("Sucessfully Connected!", "Let op!", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1)
End If
Catch err As MySqlException
MessageBox.Show(err.Message, "Unable to Connect")
connect.Close()
End Try
End Sub
Hope this helps. Have a nice day!
VirusTotal
Virscan