System.Data.EntityException: The underlying provider failed on Open.
场景:IIS默认站点建立程序,使用Windows集成身份验证方式,连接SQLServer数据库也是采用集成身份验证。我报“System.Data.EntityException: The underlying provider failed on Open.”这个错误是因为计算机登录密码改过,导致之前应用程序池设置的凭证错误,解决办法:把应用程序池的登录凭证也修改一下改成和计算机登录密码一样,这样程序就好了。
步骤:
新增一个应用程序:
IIS Default Web Site-->Add Application-->Application Pool-->ASP.NET V4.0 Integrated
修改应用程序池的凭证:
Application Pool-->ASP.NET V4.0 Integrated-->Advanced Settings-->Process Model-->Identity-->Customer account-->Set Credentials-->Set UserName=Cumputer LoginName,Password=Cumputer Login Password-->Click OK
配置文件
<appSettings>
<add key="CreditCheckGatewayDB" value="Server=fscnbesd0001;Database=CreditCheckGateway;Integrated Security=SSPI;" />
</appSettings>
C#读取连接字符串
static public string GetCupCreditCheckConnectionString
{
get
{
return string.Format("metadata=res://*/CupModel.csdl|res://*/CupModel.ssdl|res://*/CupModel.msl;provider=System.Data.SqlClient;provider connection string=\"{0}\";", ConfigurationManager.AppSettings["CreditCheckGatewayDB"]);
}
}
或者配置文件直接写
<appSettings>
<add key="CupCreditCheckDB" value="metadata=res://*/CupModel.csdl|res://*/CupModel.ssdl|res://*/CupModel.msl;provider=System.Data.SqlClient;provider connection string="Server=fscnbesd0001;Database=CreditCheckGateway;Integrated Security=SSPI"" providerName="System.Data.EntityClient" />
</appSettings>
<connectionStrings>
<add name="CupCreditCheckDB" connectionString="metadata=res://*/CupModel.csdl|res://*/CupModel.ssdl|res://*/CupModel.msl;provider=System.Data.SqlClient;provider connection string="Server=fscnbesd0001;Database=CreditCheckGateway;Integrated Security=SSPI"" providerName="System.Data.EntityClient" />
</connectionStrings>
System.Data.EntityException: The underlying provider failed on Open.的更多相关文章
- System.Data.Entity.Core.EntityException: The underlying provider failed on Open. ---> System.InvalidOperationException: 超时时间已到。超时时间已到,但是尚未从池中获取连接。出现这种情况可能是因为所有池连接均在使用,并且达到了最大池大小。
2017/8/15 20:55:21 [AgentPayQuery_205506102_1BBBB]系统异常:System.Data.Entity.Core.EntityException: The ...
- EntityFrame6在本地可以正常使用,部署到IIS后报异常(Additional information: The underlying provider failed on Open.)
异常详细:An exception of type 'System.Data.Entity.Core.EntityException' occurred in EntityFramework.SqlS ...
- asp.net网站运行出错:the underlying provider failed on open的解决
在登录系统,通过linq查询时发生错误,the underlying provider failed on open,如何解决,请看: Step 1:Open Internet Information ...
- The underlying provider failed on Open. EF
本地测试是可以的:但是放到服务器上就不行了: 报错:"The underlying provider failed on Open." 这一情况和我以前遇上的一次错误有点相似啊:都 ...
- 如何解决The underlying provider failed on Open问题
转自codeproject,找了半天解决办法,这个最靠谱. 我数据库用的EF做ORM,在vs里面测试的时候不会出现这个错误,用IIS就出错了.解决方法如下 Solution for "The ...
- 【EF数据库链接报错】“The underlying provider failed on open”
EF在操作数据库时要反复链接.断开数据库,如果连接字符串是windows 服务验证,而不是用的用户名和密码,那么尝试访问数据库的用户是NT AUTHORITY\NETWORK SERVICE.权限不够 ...
- EntityFrame Work:No Entity Framework provider found for the ADO.NET provider with invariant name 'System.Data.SqlClient'
今天试着学习了Entity Frame Work遇到的问题是 The Entity Framework provider type 'System.Data.Entity.SqlServer.SqlP ...
- The Entity Framework provider type 'System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer' registered in the application config file for the ADO.NET provider with invariant name
可以强迫部署EntityFramework.SqlServer.dll这个文件到输出目录 找到1个老外的帖子,戳这里(本人测试无效,大家有可能试一下..) 解决方案以下: 在EF的上下文代码CS文件( ...
- SQL Server System.Data.SqlClient.SqlException:已成功于服务器建立连接,但是在 登录前的握手期间发生错误
一.错误描述 错误名称如上.整体错误如下: System.Data.EntityException 基础提供程序在Open上失败--> System.Data.SqlClient.SqlExce ...
随机推荐
- Installing the Solidity Compiler¶
Versioning¶ Solidity versions follow semantic versioning and in addition to releases, nightly develo ...
- [转][C#]基础连接已经关闭 未能为 SSL/TLS 安全通道建立信任关系
来自:https://www.cnblogs.com/waw/p/8286608.html 代码部分: static TestApplication(){ ServicePointManager.Se ...
- 漫谈Objective-C在语法上的改进
Objective-C 2.0从2006年正式发布至今已经有10年了.Apple在此期间也不断地为其注入新的语法特性,比如Blocks.NSNumber literal.NSArray literal ...
- 阶段5 3.微服务项目【学成在线】_day02 CMS前端开发_25-前后端请求响应流程小结
看图
- 深入理解Flink ---- End-to-End Exactly-Once语义
上一篇文章所述的Exactly-Once语义是针对Flink系统内部而言的. 那么Flink和外部系统(如Kafka)之间的消息传递如何做到exactly once呢? 问题所在: 如上图,当sink ...
- Anaconda3详细安装使用教程及问题总结
1.Anaconda是什么? 简单来说,Anaconda是Python的包管理器和环境管理器. 先来解决一个初学者都会问的问题:我已经安装了Python,那么为什么还需要Anaconda呢?原因有以下 ...
- python中星号变量的几种特殊用法
python中星号变量的几种特殊用法 不知道大家知不知道在Python中,星号除了用于乘法数值运算和幂运算外,还有一种特殊的用法"在变量前添加单个星号或两个星号",实现多参数的传入 ...
- phpcms后台添加会员报v9_sso_member表缺失
坑货..表前缀设置 两个地方都有 一个是默认的caches/configs/目录 还有个是phpsso_server/caches/configs/ 如果改了表前缀 这两个地方的database都要改 ...
- [C++/JavaScript]数据结构:栈和数列>案例引入(数制的转换)
1 案例1:数制的转换 1.1 背景与原理 1.2 编程复现 (JavaScript版 复现) function convert(value, d){ stack = []; // 栈 result ...
- Java中处理OPC寄存器数据类型
1. 在milo中,处理WORD等数据类型 例子如下: VariableNode node = client.getAddressSpace().createVariableNode( new Nod ...