MSSQL Error 'The underlying provider failed on Open'

前端 未结 30 2551
时光取名叫无心
时光取名叫无心 2020-11-22 09:51

I was using an .mdf for connecting to a database and entityClient. Now I want to change the connection string so that there will be no

相关标签:
30条回答
  • 2020-11-22 10:26

    I have solved this way.

    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.

    Codeproject Solution : the-underlying-provider-failed-on-open

    0 讨论(0)
  • 2020-11-22 10:27

    Make sure that each element value in the connection string being supplied is correct. In my case, I was getting the same error because the name of the catalog (database name) specified in the connection string was incorrect.

    0 讨论(0)
  • 2020-11-22 10:27

    I had a similar issue with exceptions due to the connection state, then I realized I had my domain service class variable marked as static (by mistake).

    My guess is that once the service library is loaded into memory, each new call ends up using the same static variable value (domain service instance), causing conflicts via the connection state.

    I think also that each client call resulted in a new thread, so multiple threads accessing the same domain service instance equated to a train wreck.

    0 讨论(0)
  • 2020-11-22 10:27

    I got rid of this by resetting IIS, but still using Integrated Authentication in the connection string.

    0 讨论(0)
  • 2020-11-22 10:27

    I was also facing the same issue. Now I have done it by removing the user name and password from the connection string.

    0 讨论(0)
  • 2020-11-22 10:29

    This can also happen if you restore a database and the user already exists with different schema, leaving you unable to assign the correct permissions.

    To correct this run:

    USE your_database
    EXEC sp_change_users_login 'Auto_Fix', 'user', NULL, 'cf'
    GO
    EXEC sp_change_users_login 'update_one', 'user', 'user'
    GO
    
    0 讨论(0)
提交回复
热议问题