Vb.net Connect/net MySQL connection

Lance Johnson

Geek Trainee
Kinda web development....

This is my problem.

I have a MySQL database installed on my USB stick
This is so that i can work on my project at school which is horrible to connect to the internet, but it will be on the internet in the end

I have a program made in VB.net which should connect to the MySQL database via Connector/Net, but constantly gives me the error message

"Cannot connect to any of the specified MySQL hosts"

Code:
Imports MySql.Data.MySqlClient
------------------------------------------------------------------
Public Class frmlogin
    Dim conn As MySqlConnection

    Dim VarUser
    Dim VarPass

------------------------------------------------------------------
    Private Sub cmdlogin_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdlogin.Click
        conn = New MySqlConnection()
        conn.ConnectionString = "Server=localhost;Database=member;Uid=lance;""Pwd=test123;"
        Try
            conn.Open()
            MessageBox.Show("Connection Established to server")
            conn.Dispose()

There is a bit more to the code, but it isnt directly to do with connecting to the database, it is mostly to do with what the program does (secure login which is why i didnt post it up for obvious reasons)

When i try i do disable Firewalls (including windows firewall) and also Anti-virus but no luck...

I have made an attempt to connect to an online database with the same problem...

I am sure someone must know the solution, if you do please tell me.
As i am doing my nut on this one!

Thanks in advance
Lance

P.S
I can connect to the database via MySQL admin and add records to it via query browser. So i think there isnt a problem with the database...
 
Back
Top