Entity Framework The underlying provider failed on Open

后端 未结 19 1714
挽巷
挽巷 2020-12-02 20:12

Below is my connection string:

connectionString=\"metadata=res://*/EDMX.Test.csdl|res://*/EDMX.Test.ssdl|res://*/EDMX.Test.msl;provider=System.Data.Sq

相关标签:
19条回答
  • 2020-12-02 20:36
    1. Search "Component Services" in Programs and Files
    2. Go to Services
    3. Find "Distributed Transaction Coordinator" Service
    4. Right click and Restart the Service

    You've just done a restart of the service and the code should run without errors

    0 讨论(0)
  • 2020-12-02 20:37

    I was facing the same error today, what I was doing wrong was that I was not adding Password tag in the connection string. As soon as I added the Password tag with correct password the error went away. Hope it helps someone.

    0 讨论(0)
  • 2020-12-02 20:38

    We had connection string in web.config with Data Source=localhost, and there was this error (MSSQL was on the same machine). Changing it to actual `DOMAIN\MACHINE' helped, somewhy.

    0 讨论(0)
  • 2020-12-02 20:42

    I had this error and it was caused by a typo in the connection string in App.config.

    0 讨论(0)
  • 2020-12-02 20:45

    Possible solution is described in this Code Project tip:

    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:

    1. Open Internet Information Service Manager
    2. Click on Application Pools in left navigation tree.
    3. Select your version Pool. In my case, I am using ASP .Net v4.0. If you dont have this version, select DefaultAppPool.
    4. Right click on step 3, and select advanced settings.
    5. Select Identity in properties window and click the button to change the value.
    6. Select Local System in Built-in accounts combo box and click ok. That's it. Now run your application. Everything works well.
    0 讨论(0)
  • 2020-12-02 20:45

    For me when that usually starts happening, I have to remote desktop into the service and at the minimum restart IIS. It usually starts popping up right after I deploy code. On a few rare occasions I have had to restart the SQL services and IIS. I wrote a batch script to take a param (1 or 2) and have it setup to either do a restart of IIS ( i.e. 1), or go full nuclear (i.e. 2).

    0 讨论(0)
提交回复
热议问题