0

I have a copy of my client's database and website on my computer. There's also a matching copy of both online where my client's customers will use the website.

When I test my local copy of the website with my local database, everything works.
When I test my local copy of the website with the online database, everything works fine.

When I test the online copy of the website with the online database, I get the following 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)

I've been working with the webhost for more than 12 hours now and we've managed to verify that I am using the correct instance name.

He's very cautious so he doesn't allow remote connections, however, as the website and SQL Server both exist on the same server, I don't think this would be the problem.

I'm 99% sure the problem is that, since I'm using what we know to be the correct instance name for SQL Server, the problem has got to be communication into SQL. I feel like there's something the webhost has set that is blocking or rejecting requests made to SQL Server.

Can anyone suggest any causes for this error? I googled it but didn't find any information that was particularly enlightening - which is to say that all of the information I found covered things I've already checked.

EDIT

I'm now also unable to connect remotely with Management Studio because

Login failed for user

I have verified that my credentials are correct.

3
  • 1
    How is the "online" website accessing the database? Shared Memory? TCP/IP? How is the connection being made? Some kind of ODBC connection? We need more details.
    – joeqwerty
    Feb 24, 2015 at 15:20
  • @joeqwerty I'm just using a connection string: Data Source=.\MSSQLSERVER2014; Initial Catalog=MyDatabase; User Id=MyDatabaseUser; Password=MyDatabaseP455w0Rd;
    – Ortund
    Feb 24, 2015 at 15:31
  • Regarding your edit- just to clarify: SSMS is installed on the online server and it cannot connect to the SQL Server instance running on the same server? (I'm getting thrown off by the word "remotely".)
    – TTT
    Feb 26, 2015 at 22:33

1 Answer 1

0

Since you stated that the application runs correctly from your machine, you could test the following:

  • Check if changing the connection string to work with local IP instead of hostname works
  • Check if the application pool user on your local machine == the application pool user on the IIS
  • Ping the hostname from the server to see if it resolves correctly
  • If using windows authentication, make sure you're not using basic authentication

A quick way to test SQL Server connections directly is by creating udl files, if your web host is willing you could do a remotion session and test some different configurations using a udl file.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .