ArizonaRedneck
Programmer
I'm trying to connect to a mysql database. I'm using ByteFX. I added a reference of ByteFx to the project and use the following code:
Dim strConnectionString As String = "Data Source=mysql17.secureserver.net;" _
& "Database=*name here*;" _
& "User ID=*ID here*;" _
& "Password=*Password here*;"
Dim dstDataset As New DataSet()
Dim tblUsers As DataTable
Dim drwUserRow As DataRow
Dim strCommand As String
strCommand = "SELECT UserName from Users"
Dim darAdapter As New ByteFX.Data.MySqlClient.MySqlDataAdapter(strCommand, strConnectionString)
darAdapter.Fill(dstDataset, "Users")
tblUsers = dstDataset.Tables("Users")
For Each drwUserRow In tblUsers.Rows
Response.Write(drwUserRow("UserName"))
Next
I get the following error:
"Unable to connect to any of the specified MySQL hosts"
I've used similar code to connect to sql server and never had any problems. I'm not sure if it's my connection string or just ByteFX... Please Help!
Dim strConnectionString As String = "Data Source=mysql17.secureserver.net;" _
& "Database=*name here*;" _
& "User ID=*ID here*;" _
& "Password=*Password here*;"
Dim dstDataset As New DataSet()
Dim tblUsers As DataTable
Dim drwUserRow As DataRow
Dim strCommand As String
strCommand = "SELECT UserName from Users"
Dim darAdapter As New ByteFX.Data.MySqlClient.MySqlDataAdapter(strCommand, strConnectionString)
darAdapter.Fill(dstDataset, "Users")
tblUsers = dstDataset.Tables("Users")
For Each drwUserRow In tblUsers.Rows
Response.Write(drwUserRow("UserName"))
Next
I get the following error:
"Unable to connect to any of the specified MySQL hosts"
I've used similar code to connect to sql server and never had any problems. I'm not sure if it's my connection string or just ByteFX... Please Help!