Hi all,
I have been searching the net for days and cannot find a viable solution to my problem. I'm sure it's something simple I'm missing, because it usually is.
I am writing an application that I would like to connect to a remote SQL Server hosted by GoDaddy. They provide me with the Server Name (host), IP, etc - everything you need to establish a connection with VB.net - be it with the SQLadapter (SQLconnection) wizard or through code using connection strings.
BOTH methods (code and .net connection wizard) give me 'SQL Server does not exist or access is denied' error (sqlstate: 08001, sql server error: 17).
The only thing I can come up with so far is that 'Allow Remote Connections' is turned off inside the server; however, that wouldn't make any sense at all because GoDaddy's customers couldn't get any use out of the server they offer.
My code:
Dim strConnection As String = "Data Source=remoteserver1234; Initial Catalog=database123; User ID=user123; Password=pass123;"
Dim conn As New SqlConnection(strConnection)
Dim strCommand As String = "SELECT * FROM Table" 'WHERE Table.Fname = " & strFname
Dim dataAdapter As New SqlDataAdapter(strCommand, conn)
Dim ds As New DataSet
dataAdapter.Fill(ds, "Table")
The connection fails when I try using the wizard as well, so even if this code is incorrect (which I doubt since I've referenced it on several different sites) - something is still off. Pulling hair out at this point - any help is VERY much appreciated. Thanks!
I have been searching the net for days and cannot find a viable solution to my problem. I'm sure it's something simple I'm missing, because it usually is.
I am writing an application that I would like to connect to a remote SQL Server hosted by GoDaddy. They provide me with the Server Name (host), IP, etc - everything you need to establish a connection with VB.net - be it with the SQLadapter (SQLconnection) wizard or through code using connection strings.
BOTH methods (code and .net connection wizard) give me 'SQL Server does not exist or access is denied' error (sqlstate: 08001, sql server error: 17).
The only thing I can come up with so far is that 'Allow Remote Connections' is turned off inside the server; however, that wouldn't make any sense at all because GoDaddy's customers couldn't get any use out of the server they offer.
My code:
Dim strConnection As String = "Data Source=remoteserver1234; Initial Catalog=database123; User ID=user123; Password=pass123;"
Dim conn As New SqlConnection(strConnection)
Dim strCommand As String = "SELECT * FROM Table" 'WHERE Table.Fname = " & strFname
Dim dataAdapter As New SqlDataAdapter(strCommand, conn)
Dim ds As New DataSet
dataAdapter.Fill(ds, "Table")
The connection fails when I try using the wizard as well, so even if this code is incorrect (which I doubt since I've referenced it on several different sites) - something is still off. Pulling hair out at this point - any help is VERY much appreciated. Thanks!