zoukankan      html  css  js  c++  java
  • 如何解决The underlying provider failed on Open问题

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

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

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

    By 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 AUTHORITYNETWORK 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

  • 相关阅读:
    被Play framework狠狠的play了一把
    ant导入Zookeeper到Eclipse错误path contains invalid character
    Hadoop2.4代码的坑
    uml类关系
    Hadoop 源码编译导出
    Eclipse 导入 Hadoop 源码
    js中的prototype和constructor
    react之路:使用redux-immutable
    react之路:使用actionCreators和constants
    react之路:使用combineReducers拆分reducer
  • 原文地址:https://www.cnblogs.com/matoo/p/3303298.html
Copyright © 2011-2022 走看看