1 Replies - 3676 Views - Last Post: 20 January 2012 - 07:27 PM

#1 chieto  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 18-January 10

Connecting to a Remote Database(mySQL) on LAN and vb.net

Posted 20 January 2012 - 07:16 PM

I have connected VB.net and mySQL on a the same PC before, but I have no Idea how to connect VB.net to a remote PC(LAN)

I've only changed the server

This is my code. I removed some of the details, but it works on server=localhost

(Toggle Plain Text)
conn = New MySqlConnection()
conn.ConnectionString = "server=192.168.1.4;" & _
"user id=root;" & _
"password=;" & _
"database=system"

Try
conn.Open()
MsgBox("You have control")
conn.Close()
Catch ex As Exception
MsgBox("Connection Failed")
End Try

I have turned off firewalls from both sides, and it keeps returning "Connection Failed"

Is This A Good Question/Topic? 0
  • +

Replies To: Connecting to a Remote Database(mySQL) on LAN and vb.net

#2 hbkguy  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 20-January 12

Re: Connecting to a Remote Database(mySQL) on LAN and vb.net

Posted 20 January 2012 - 07:27 PM

This is Working for me
conn = New MySqlConnection("server=99.65.0.9;Port=3306; user id=user; password=password; database=Database")

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1