Reputation: 14113
I am unsing entity framework in my web application. Earlier everything was working fine. But then I deleted database from Sql Server. After that whenever I run the application, I get the following exception :
The underlying provider failed on open entity framework
Isn't it true that if we delete the database from Sql Server and again run the application, database is again created?
Upvotes: 3
Views: 10305
Reputation: 1
I had a similar error and it was due to the connection problem. Usually you need to open your *.EDPS file under your entity (EDML) and check your connection string and make sure it has got a correct setting especially your Default Oracle home.
Upvotes: 0
Reputation: 6043
Can you show some details about connection string. I basically want to check the authentication you are using. Demo for setting a typical authentication : http://msdn.microsoft.com/en-us/library/ff649314.aspx
Another possibility can be with connection pooling. Try explicitly closing the connection(if there are any open connections)
db.Database.Connection.Close();
Upvotes: 3
Reputation: 34248
Entity framework will recreate your database on application start assuming the following:
Upvotes: 3