Anyone had an idea how to connect vb.net windows form application program into online / intranet database?
I tried using localhost, yes it connect but if i use IP in the HOST i cant access the database.
Here is my connection:
Dim conStr As String = "server=192.168.1.18;Uid=root;Pwd='';Database=hrms"
Dim con As New MySqlConnection(conStr)
Try
MessageBox.Show("Connecting to mysql database..................")
con.Open()
Dim sqlStr As String = "SELECT * FROM accounts"
Dim cmd As MySqlCommand = New MySqlCommand(sqlStr, con)
Dim rd As MySqlDataReader = cmd.ExecuteReader
rd.Read()
If rd.HasRows Then
MessageBox.Show(rd(0) & " " & rd(1) & " Naa koi na fetch")
Exit Sub
Else
MessageBox.Show("Could not find something")
Exit Sub
End If
con.Close()
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try