0
votes

I've been running an ASP.NET MVC application on my IIS 7.5 localhost (on my Win7 Pro box) server with SQL Server 2005 Developer Edition.

I went to put the application on my production server (IIS 7, SQL Server 2008) and am getting SQL Server connection errors. Here is the error I get when I try to browse site root:

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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

I have triple checked my connection string. My host's connection string was in the format XXX.XX.XX.XX,XXXX. Is it normal to have a comma following the IP Address?

Does anyone have any suggestions for something I may be missing?

Thanks.

2

2 Answers

2
votes

Take a look at this resource:

http://www.connectionstrings.com/sql-server-2008

A comma after the IP address indicates the port. It should be 1433 unless you have multiple instances.

0
votes

First of all, make sure that the Windows Firewall (and any other firewall software) on that machine is configured to allow incoming connections to SQL Server. See here for instructions.

Second, check that the SQL Server Browser service in the database server machine is running. This is not necessary in all the connection scenarios, so you may need to provide more details. For example, are you using default listen ports for your server?