I have an MVC3 project that uses EF 4.1 database first with a SQL Server CE database. On my dev box, which has SQL Server Express installed, everything works fine. However, when deploying to another server that does not have SQL Server Express installed (or any SQL Server Instance), the connection understandably fails. Is it possible to use EF 4.1 with a SQL Server CE database on a box that does not have a local SQL Server instance?
Even if I try to reference a remote SQL instance, I receive an error
Invalid value for key ‘attachdbfilename’
Here is what the connection string looks like:
<add name="AlertsEntities" connectionString="metadata=res://*/Models.AlertsModel.csdl|res://*/Models.AlertsModel.ssdl|res://*/Models.AlertsModel.msl;provider=System.Data.SqlClient;provider connection string="data source=.\SQLEXPRESS;attachdbfilename=|DataDirectory|\Alerts.mdf;integrated security=True;connect timeout=30;user instance=True;multipleactiveresultsets=True;App=EntityFramework"" providerName="System.Data.EntityClient" />
Just to update how we solved this problem, we ended up just installing SQL express on the same server as the application using SqlCE. I’m accepting this answer just because the other one didn’t really answer the question at all.