场景: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=&quot;Server=fscnbesd0001;Database=CreditCheckGateway;Integrated Security=SSPI&quot;" 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=&quot;Server=fscnbesd0001;Database=CreditCheckGateway;Integrated Security=SSPI&quot;" providerName="System.Data.EntityClient" />
</connectionStrings>

    

System.Data.EntityException: The underlying provider failed on Open.的更多相关文章

  1. 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 ...

  2. EntityFrame6在本地可以正常使用,部署到IIS后报异常(Additional information: The underlying provider failed on Open.)

    异常详细:An exception of type 'System.Data.Entity.Core.EntityException' occurred in EntityFramework.SqlS ...

  3. asp.net网站运行出错:the underlying provider failed on open的解决

    在登录系统,通过linq查询时发生错误,the underlying provider failed on open,如何解决,请看: Step 1:Open Internet Information ...

  4. The underlying provider failed on Open. EF

    本地测试是可以的:但是放到服务器上就不行了: 报错:"The underlying provider failed on Open." 这一情况和我以前遇上的一次错误有点相似啊:都 ...

  5. 如何解决The underlying provider failed on Open问题

    转自codeproject,找了半天解决办法,这个最靠谱. 我数据库用的EF做ORM,在vs里面测试的时候不会出现这个错误,用IIS就出错了.解决方法如下 Solution for "The ...

  6. 【EF数据库链接报错】“The underlying provider failed on open”

    EF在操作数据库时要反复链接.断开数据库,如果连接字符串是windows 服务验证,而不是用的用户名和密码,那么尝试访问数据库的用户是NT AUTHORITY\NETWORK SERVICE.权限不够 ...

  7. 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 ...

  8. 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文件( ...

  9. SQL Server System.Data.SqlClient.SqlException:已成功于服务器建立连接,但是在 登录前的握手期间发生错误

    一.错误描述 错误名称如上.整体错误如下: System.Data.EntityException 基础提供程序在Open上失败--> System.Data.SqlClient.SqlExce ...

随机推荐

  1. JAVA基础知识|进程与线程

    一.什么是进程?什么是线程? 操作系统可以同时支持多个程序的运行,而一个程序可以狭义的认为就是一个进程.在一个进程的内部,可能包含多个顺序执行流,而每个执行流就对应一个线程. 1.1.进程 进程:是计 ...

  2. 写给新手看的 MyBatis 入门

    目录 MyBatis 使用前的准备 什么是 MyBatis 使用Maven 进行 MyBatis 开发环境搭建 MyBatis 入门 项目整体结构一览 MyBatis 的简单生命周期 1.获取 Sql ...

  3. PyTorch Tutorials 1 PyTorch是什么?

    %matplotlib inline PyTorch是什么? 基于Python的科学计算包,服务于以下两种场景: 作为NumPy的替代品,可以使用GPU的强大计算能力 提供最大的灵活性和高速的深度学习 ...

  4. pre-fork 分叉 软分叉 硬分叉 前叉实现 pre-fork implementation

    https://mp.weixin.qq.com/s/wIDTs2J1ZkLkAEHqQnkYnw 什么是分叉?为何对区块链发展至关重要? Uselink公有链 Uselink公有链 2018-12- ...

  5. 《maven实战》笔记(5)----maven的版本

    maven中构件和项目都有自己的版本,其中分为稳定的发布版本和不稳定的快照版本. 1.0.0.1.3-alpha-4和2.0就是稳定版本,而2.1-SNAPSHOT和2.1-20091214.2214 ...

  6. js中string和json的相互转换

    1.将string转成json var json={}; var myorderno=$("#myorderno").val(); json.myorderno=myorderno ...

  7. 01-02 Flutter仿京东商城项目 功能分析、底部导航Tab切换以及路由配置、架构搭建:(Flutter仿京东商城项目 首页布局以及不同终端屏幕适配方案)

    Flutter和Dart交流学习群:交流群:452892873 01Flutter仿京东商城项目 功能分析.底部导航Tab切换以及路由配置.架构搭建 02Flutter仿京东商城项目 首页布局以及不同 ...

  8. thinkphp5 更改入口文件在主目录

    默认thinkPHP入口文件在public/index.php,而在虚拟主机部署时,不能设置访问路径,因此需要将入口文件放置在主目录上. 一.主目录下新建index.php 复制以下内容 // 定义应 ...

  9. socket编程之黏包

    原理概述 上图是我在学习python的socket编程中遇到的黏包问题所画,以实例来说明这个高大上的黏包问题. 我们知道socket()实例中sendall()方法是无论数据有多大,一次性提交写入缓冲 ...

  10. Hadoop 部署之 HBase (四)

    目录 一.HBase是什么 HBase 和 HDFS HBase的存储机制 二.HBase 集群部署 1.下载安装 2.配置 HBase 环境变量 三.HBase 配置(namenode01) 1.配 ...