Use SQL Server CE Locally and SQL Server 2008 at the beginning of Framework Entity Entity?

First I use EF Code to create my models. I added SQL Server Compact Edition to my project and use it as a local database.

I want to configure the DataContext so that when I click on Production (based on the name of the machine) I would instead pull it out of the connection string in Web Config and use the SQL Server 2008 database.

What is the easiest way to do this? Basically, my question is at what point do I need to add a condition so that when it is deployed, it will pull in the connection string and just work.

Is this even a recommended approach?

+3
source share
2 answers

, ConnectionString App.Config

" " (Debug/Release/etc.), MSBuild.

+1

, . , , MSBuild .

#IF DEBUG - , , , !

+1

All Articles