转自codeproject,找了半天解决办法,这个最靠谱。

我数据库用的EF做ORM,在vs里面测试的时候不会出现这个错误,用IIS就出错了。解决方法如下

Solution for "The underlying provider failed on Open" exception.

By venugopalm, 11 Nov 2010
 
 
As you guys know that I am posting enterprise architecture design article in code project here. While preparing third part, I started to implement simple tier application for demo. After completing server side implementation, I started to implement simple client for demo purpose. Once completed with client, i tried to run my demo application. But unfortunately I got the strange exception called "The underlying provider failed on Open". I googled more than an hour and found that most of the folks facing the same issue when they try to call the service which contains database access in local sql server through IIS. But no one is providing proper solution for this issue. Everyone says that IIS uses network credentials when it contacts sql server authentication process. So we should grant access to "NT AUTHORITY\NETWORK SERVICE" to your database.
But this is not the right solution and no one is saying how to fix the issue. After spending some hours, found the solution and my app running without any issues.

Here is the solution.

As folks mentioned IIS user network service user credentials while trying to log in sql server. So just change the Application pool settings in your IIS.
 
Step 1:
Open Internet Information Service Manager
Step 2:
Click on Application Pools in left navigation tree.
Step 3:
Select your version Pool. In my case, I am using ASP .Net v4.0. If you dont have this version, select DefaultAppPool.
Step 4:
Right click on step 3, and select advanced settings.
Step 5:
Select Identity in properties window and click the button to change the value.
Step 6:
Select Local System in Built-in accounts combo box and click ok.
That's it. Now run your application. Everything works well.
 
Enjoy!!!.

http://www.codeproject.com/Tips/126919/Solution-for-The-underlying-provider-failed-on-Ope?msg=4226646#xx4226646xx

如何解决The underlying provider failed on Open问题的更多相关文章

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

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

  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. System.Data.EntityException: The underlying provider failed on Open.

    场景:IIS默认站点建立程序,使用Windows集成身份验证方式,连接SQLServer数据库也是采用集成身份验证.我报“System.Data.EntityException: The underl ...

  4. The underlying provider failed on Open. EF

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

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

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

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

  7. (转) 解决ssh的"Write failed: Broken pipe"问题

    解决ssh的"Write failed: Broken pipe"问题   问题场景 服务器环境:阿里云 Linux CentOS 主机 客户端:Mac OSX Terminal ...

  8. 如何解决WebkitBrowser使用出错“Failed to initialize activation context”

    本文转载自:http://www.cnblogs.com/supjia/p/4695671.html 本篇文章主要介绍了"如何解决WebkitBrowser使用出错“Failed to in ...

  9. 解决 EDAS:Upload failed: The right margin is 0.535 in on page 1 问题

    参考: IEEETran page margins 解决 EDAS:Upload failed: The right margin is 0.535 in on page 1 问题 在 EDAS 上上 ...

随机推荐

  1. 深入理解C指针----学习笔记

      深入理解C指针     第1章 认识指针   理解指针的关键在于理解C程序如何管理内存,指针包含的就是内存地址.     1.1 指针和内存   C程序在编译后,以三种方式使用内存: 1. 静态. ...

  2. python 实现字符串转整型

    def str2Int(s): l=list(s) if len(l)<=0: return 0 flag=0 sum=0 dict_num={':9} dict_tag={'+':1,'-': ...

  3. 【日期控件】JQueryUI的datepicker日期控件

    在输入日期的时候我们经常需要日期控件,jQueryUI的datapicker就是一个很好的日期控件. 1.简单的datepicker控件 目录结构:(要将images图片放到css目录下面)

  4. PyQt: eg2

    #coding:utf-8 from __future__ import division import sys from math import * from PyQt4 import QtCore ...

  5. linux 定时执行任务 at atq atrm命令的使用

    1.at命令在指定时刻执行指定的命令序列 at [-V] [-q 队列] [-f 文档名] [-mldbv] 时间 下面对命令中的参数进行说明.-V 将标准版本号打印到标准错误中.-q queue 使 ...

  6. MINI_httpd移植,构建小型WEB服务器

    一.简介 目的:构建小型WEB站,具备SSL. mini_httpd is a small HTTP server. Its performance is not great, but for low ...

  7. fedora16下更改网卡名字

    fedora16下更改网卡名字   今天由于网络启动出错的原因,在网上搜索,发现大部分人的网卡名字都是eth0,可是我的却是p3p1,所以想改成eth0.   然后google了下,发现设备命名什么的 ...

  8. IEEEXtreme 10.0 - Goldbach's Second Conjecture

    这是 meelo 原创的 IEEEXtreme极限编程大赛题解 Xtreme 10.0 - Goldbach's Second Conjecture 题目来源 第10届IEEE极限编程大赛 https ...

  9. linux用户帐号管理/etcpasswd 和/etc/shadow文件

    #学习鸟哥的linux私房菜 /etc/passwd的文件构造: dahu@dahu-OptiPlex-:~/myfile/VideoFile$ head /etc/passwd root:x:::r ...

  10. python开发学习-day04(迭代器、生成器、装饰器、二分查找、正则)

    s12-20160123-day04 *:first-child { margin-top: 0 !important; } body>*:last-child { margin-bottom: ...