I've inherited an Umbraco .NET MVC website from someone, and I'm trying to get it running locally.
There are two databases involved, I've restored backups of them in my local copy of SQL Server 2014 Express and I have set up my web.config so they are both pointing at the relevant databases via integrated mode, and I have double checked the connection by using Visual Studio Pro 2013's Server Explorer.
I started with a connection string:
"SUPERAWESOMEPC\SQLEXPRESS;database=SuperAwesomeDatabase;Integrated Security=True"
and Server Explorer outputs:
"Data Source=SUPERAWESOMEPC\SQLEXPRESS;Initial Catalog=SuperAwesomeDatabase;Integrated Security=True"
So I went and tried that as well. Neither of these connection strings work within the web.config - even though one of them is the connection string output by Server Explorer.
I always get errors where the inner exception is:
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)
and within that:
The network path was not found
I have also been developing on another Umbraco site using the same instance of SQL Server Express 2014, and that connects absolutely fine every time, so SQL Server can definitely accept connections, and I don't think it's that there are specific ports to open.
Other information - I am also using the attribute: providerName="System.Data.SqlClient"
with the connection string, and the original connection string I received was using sa
as the user.
I tried setting up a user just for this, setting up the login in SQL Server Manager under Security -> Logins, and then adding the user under Security -> Users for each of the two databases - but I couldn't even get those new users to connect under VS2013 Server Explorer.
Can you think of other things that might prevent the application from connecting to the db?
Is there any way I can get more debug info - so it tells me what connection string it's actually trying when it's failing?
Posting this in case it helps anyone in the future -
It turned out that the solution I was looking at wasn't actually using the connection string in my web.config - it was using a data source from a reference which contained a baked-in connection string.
So I had to open a different solution, build that, and copy over the dlls.