I've spent the past two days going through google (and here) with different variations of a connection string on my deployment server... If I had hair left, I'd have pulled it out by now... ;)
I have an application that runs perfectly on my development Win7 box and am working on deploying it to a test server before I put it into beta.
The test server is Windows 2008 R2 with IIS 7.
I'm able to deploy the application to IIS and the site comes up.
But when I got to a page that connects to the SQL Server Express running on the local host, it dies. I should also mention that the database is already existing on the SQL Server Express instance and my Winforms and service application works great when connecting to that database.
My web.config
contains the following connection string:
<add name="OIDEntities"
connectionString="metadata=res://*/Models.OID.csdl|res://*/Models.OID.ssdl|res://*/Models.OID.msl;provider=System.Data.SqlClient;provider connection string="Data Source=.\SQLEXPRESS;Initial Catalog=OID;Integrated Security=True;MultipleActiveResultSets=True;Application Name=EntityFramework""
providerName="System.Data.EntityClient" />
The error I get is:
The underlying provider failed on Open.
I've tried resetting the service in SQL Server to nt authority\network service
(to match the app pool). I've also tried creating a SQL Server user and using the following connection string:
<add name="OIDEntities"
connectionString="metadata=res://*/Models.OID.csdl|res://*/Models.OID.ssdl|res://*/Models.OID.msl;provider=System.Data.SqlClient;provider connection string="Data Source=.\SQLEXPRESS;Initial Catalog=OID;User ID=OID_User;Password=MyPrivatePAss;MultipleActiveResultSets=True;Application Name=EntityFramework""
providerName="System.Data.EntityClient" />
I've gone into the SQL Server configuration manager and configured / enabled named pipes then TCP/IP and used the host IP to connect through server= in the connection string.
I am able to log into SQL Server Management Studio with the username/password and also using the IP vs. the instance name of .\SQLExpress
.
What am I missing?