A network-related or instance-specific error occurred while establishing a connection to SQL Server
Posted
by sf
on Server Fault
See other posts from Server Fault
or by sf
Published on 2009-12-16T13:30:33Z
Indexed on
2010/03/28
9:03 UTC
Read the original article
Hit count: 614
Hi,
I'm getting the following error when trying to load an Asp.NET MVC App on IIS 7 with Sql Server 2008 Express. The App uses Linq to SQL.
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've done some searching and all answers point to enabling TCP connections in Sql Server Configuration which I have done to no avail.
The connection string I am using is:
Server=SERVERNAME\SQLEXPRESS;Database=DBName;Integrated Security=true
The catch. I have another app that already could talk to the Sql Server just fine. Even before playing around with the Sql Server Configuration Settings.
The other app uses the following connectionstring:
Data Source=SERVERNAME\SQLEXPRESS;Initial Catalog=OtherDbName;Integrated Security=True;Persist Security Info=False;Connect Timeout=120
I've tried this connectionstring on the app that isn't working and it still doesn't work.
Please help. I think i'm about to go crazy
© Server Fault or respective owner