I'm just trying to connect vb.net application to my cpanel web host space's mysql database.
I got some idea from internet and tryied. But It doesn't work for me. If you know about this help me. I think it was great help for others too.
my whole code is this :
Imports System.Data.SqlClient Imports MySql.Data.MySqlClient Public Class Form1 Dim dr As MySqlDataReader Dim con As New MySqlConnection Dim da As New MySqlDataAdapter Dim ds As New DataSet Dim cmd As New MySqlCommand Dim query As String Public dt As DataTable Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load con.ConnectionString = "server=//22.214.171.124;Port=3306; User ID=xyz; password=#1dFs@#gc53; database=testonline" Try con.Open() MessageBox.Show("Okay") Catch ex As Exception MessageBox.Show(ex.Message) End Try End Sub End Class
however this say : "Unable to connect to ant specified host"