title: How to connect vb.net to ONLINE MySQL database?
body: <p>Anyone had an idea how to connect vb.net windows form application program into online / intranet database?</p>
  
  <p>I tried using localhost, yes it connect but if i use IP in the HOST i cant access the database.</p>
  
  <p>Here is my connection:</p>
  
  <pre><code>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) &amp; " " &amp; rd(1) &amp; " 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 
  </code></pre>