IIS 7 can't connect to SQLServer 2008

Posted by Nicolas Cadilhac on Stack Overflow See other posts from Stack Overflow or by Nicolas Cadilhac
Published on 2009-02-13T16:49:28Z Indexed on 2010/06/01 4:43 UTC
Read the original article Hit count: 643

Sorry if this is the most seen question on the web, but this is my turn. I am trying to publish my asp.net mvc app on IIS 7 under MS Sql Server 2008. I am on a Windows Server 2008 virtual machine. I get the following classical 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)

Under SQLServer, Allow remote connections is checked. My connection string is:

Data Source=.\MSSQLSERVER;Initial Catalog=mydbname;User Id=sa;Password=mypassword

I also tried with no username/password and "Integrated Security=true". There is only one instance of SQLServer installed. I tried to access my web page locally and remotely. There is no active firewall on the virtual machine.

Thx for your help.

© Stack Overflow or respective owner

Related posts about sql-server

Related posts about asp.net-mvc