Entity Framework from scratch Part 3 EF4 Database
July 19, 2010
How to connect your existing database to a new entity Framework driven app. I was surprised about the ease of connecting the database to the app. It takes just 5 steps to realise the connection with any available database. EF supports all sorts of databases.
Here we go: First open your project and right click Shoeshoedata
Then we select Ado.net Entity Data Model and name it Myshoes.edmx
Choose your excisting datamodel
Choose your data Connection, in this case we use the excisting’ Shoe’ database
Select which tables (or views) you’ll need for your EF app
and the database is connected to your new EF4 project. See that was easy.
Now the project is ready to use your database.
And now for the Multiple solution config in EF4
Is this yet another famous Microsoft workaround!? Since the new EF4 app couldn’t find his connection string.
We we’re looking for a solution to get our App.config to communicate with the console reference. this problem only occurs when you work with multiple project solutions, he can’t seem to find the correct references.
We found out it doesnt work when you just change the .config properties to Copy always, you also need to copy the app.config file to the console app. as soon as this is done, it works. Maybe there is another solution for this problem, but i have not yet found it.