Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 ASP.NET
 Accessing SQL db remotely

Author  Topic 

Phaedos
Starting Member

2 Posts

Posted - 2009-01-25 : 13:57:45
Hi,

My website has to access a very simple table which is part of an SQLExpress database existing on my home laptop. Everything works great when I do this locally, but when I upload the website to my host (DISCOUNT ASP hosts), I keep getting the error :

"A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified) "

The connection string I am using in my C# code is
new SqlConnection("Server=xx.xxx.xx.xx\\SQLEXPRESS;Database=mydbName;" + "Integrated Security=True");

when I run in visual studio, and xx.xxx.xx.xx is localhost, everything works fine, but from the webhost the above error just occurs.

The IP address I am using for xx.xx.xx.xx is the one whatsmyip.com is giving for my laptop, is that correct?

I've also disabled windows firewall and my mcafee firewall completley(for now), and used the SQL Surface area configuration tool to enable local and remote connections on TCP/named pipes, and I've started the server browser running.

I am comp new to this, so would really appreciate any help offered

thanks

Phaedos
Starting Member

2 Posts

Posted - 2009-01-25 : 15:46:42
Turns out, I needed to enable port forwarding on port my router I think. I'm still not getting the page up, but now the error is Login failed for user ''. The user is not associated with a trusted SQL Server connection.
Because obviously I havent added the web hosts ip as a trusted user.....How would I actually do this? I know to add other users on the network its through surface area, but not sure how to add a remote comp as trusted?

Cheers again
Go to Top of Page
   

- Advertisement -