VS2010 C# SQL Server 2008 Express
I developed a couple of apps using Entity Frameworks 4.1. I used the database first method (I think) in that I created a database in Visual Studio 2010 and then created a model and finally the code from the model to access the database. This worked and I found that the IDE and the application uses a user instance of SQL Server 2008 Express.
I found out that User Instances are no longer in vogue and have been deprecated. So I guess I should move the database base files to the data directory of SQL Server. Easy enough.
But now will the EF infrastructure continue to work if I remove the User Instance from the connection string and point it to the main SQL Server? Do I have to regenerate the model? Is there some other course of action I should take?
You can set the connection string for your application using the app.config or web.config files.
Add the connection string as you would for any other application:
Next, for your DbContext you Point it to your connection string:
With these you should be able to set any configuration string you like. With this in mind, I’d also like to point you to this article on migrations for plating your database: http://msdn.microsoft.com/en-us/data/jj554735