Add Entity Framework database to existing Umbraco site
Hello,
I am trying to create an Entity Framework database to an existing Umbraco project. I have setup all the MVC files I require according to the following tutorial:
Getting Started with Entity Framework
I am aware of the option of using PetaPoco to create and access databases within the main Umbraco database, but wanted to keep the data separate.
For some reason, the database will not create itself. I can see the reference to the connection in Server Explorer, but there is no database to connect to and it keeps telling me the login has failed. For that matter, I am not able to find the database anywhere on my local dev machine.
My suspicion is that Umbraco is somehow interfering with the creation of and connection to the Entity Framework database.
Is this the case?
If so, is it even possible to add a separate entity framework database to an Umbraco project? I have looked into this and it appears that you can add Umbraco to an existing DB, bu I am really trying to do the opposite.
Check / double check your EF connection strings, are you able to connect with sql server management studio or even vs db explorer using those credentials? We have a number of sites with separate Db that is hit using EF within the context of an umbraco site.
I have tried many different EF connection strings. The biggest problem seems to be that the database never gets created, although the connection shows up in Server Explorer with a red x next to it.
I tired shutting off my antivirus, firewall etc. But that didn't help either.
I also tried following the same steps with a new VS solution without umbraco. That solution created the database and, while the connection still showed an x next to it, a new database was created that I could open and examine the tables. I could also locate the database file in my directory, something I can't do when I try with umbraco installed.
Add Entity Framework database to existing Umbraco site
Hello,
I am trying to create an Entity Framework database to an existing Umbraco project. I have setup all the MVC files I require according to the following tutorial: Getting Started with Entity Framework
I am aware of the option of using PetaPoco to create and access databases within the main Umbraco database, but wanted to keep the data separate.
For some reason, the database will not create itself. I can see the reference to the connection in Server Explorer, but there is no database to connect to and it keeps telling me the login has failed. For that matter, I am not able to find the database anywhere on my local dev machine.
My suspicion is that Umbraco is somehow interfering with the creation of and connection to the Entity Framework database.
Is this the case?
If so, is it even possible to add a separate entity framework database to an Umbraco project? I have looked into this and it appears that you can add Umbraco to an existing DB, bu I am really trying to do the opposite.
Thank you.
Hi Robert
Are you using the same connection string as Umbraco?
The same database as Umbraco?
Alex
Hi Alex,
Thank you for the reply.
No, I am using a separate database and connection string for localdb.
Robert
Robert,
Check / double check your EF connection strings, are you able to connect with sql server management studio or even vs db explorer using those credentials? We have a number of sites with separate Db that is hit using EF within the context of an umbraco site.
Regards
Ismail
Hi Ismail,
I have tried many different EF connection strings. The biggest problem seems to be that the database never gets created, although the connection shows up in Server Explorer with a red x next to it.
I tired shutting off my antivirus, firewall etc. But that didn't help either.
I also tried following the same steps with a new VS solution without umbraco. That solution created the database and, while the connection still showed an x next to it, a new database was created that I could open and examine the tables. I could also locate the database file in my directory, something I can't do when I try with umbraco installed.
Thanks again for your time.
Robert
is working on a reply...