[英]The underlying provider failed on open entity framework
I am unsing entity framework in my web application. 我在我的Web应用程序中没有实体框架。 Earlier everything was working fine.
早些时候一切都很好。 But then I deleted database from Sql Server.
但后来我从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? 如果我们从Sql Server中删除数据库并再次运行应用程序,是否再次创建数据库?
Entity framework will recreate your database on application start assuming the following: 假设以下内容,实体框架将在应用程序启动时重新创建数据库:
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
用于设置典型身份验证的演示: 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();
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.
通常,您需要在您的实体(EDML)下打开* .EDPS文件并检查您的连接字符串并确保它具有正确的设置,尤其是您的默认Oracle主目录。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.