潜在的供应商未能开放的实体框架 [英] The underlying provider failed on open entity framework

查看:115
本文介绍了潜在的供应商未能开放的实体框架的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的web应用程序unsing实体框架。早些时候,一切工作正常。但后来我从SQL Server数据库中删除。之后,每当我运行应用程序,我得到以下异常:

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  

是不是真的,如果我们删除从SQL Server数据库,并再次运行应用程序,数据库再次产生的?
请大家帮帮忙。结果
谢谢,结果
尼蒂什

Isn't it true that if we delete the database from Sql server and again run the application, database is again created? Please help.
Thanks,
Nitish

推荐答案

可以显示有关连接字符串的一些细节。我基本上要检查您正在使用的身份验证。
演示设置一个典型的验证: http://msdn.microsoft.com/en-美国/库/ ff649314.aspx

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();

这篇关于潜在的供应商未能开放的实体框架的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆