[Tutorial] - MySql Connector

Posts 1–7 of 7 · Page 1 of 1
[Tutorial] - MySql Connector
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
mysql-connector-net-6.2.2.zipattachment deleted · 81 downloads before removal
File Approved

Tutorial can use a little more information, but thanks for sharing
so u are saying this is a thing tht chooses a wifi conection
Quote Originally Posted by hopefordope View Post
so u are saying this is a thing tht chooses a wifi conection
Not at all, This is a connector that is used to link visual basic and MySql for you to perform query's. It has nothing to to with an internet connection.
Mysql is used for database, However, It isn't optimal, MS Sql is more practical and doesn't have some of the limitations that mysql holds.

But it will work
Posts Deleted, I made it very clear, No Spam, No Baiting, Stay On Topic

I don't care if you take code that is offered free from MSDN , Put credit in.

Mean while, This isn't a debate thread.

keep this section clean

/Closed
Posts 1–7 of 7 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

Talk with us