MSSQL Error 'The underlying provider failed on Open'

前端 未结 30 2550
时光取名叫无心
时光取名叫无心 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:29

    A common mistake that I did because I was moving application from once pc to another and none of the above worked was that I forgot to copy the connection string to both App.Config and Web.Config!

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

    I had a similar problem: In my test-cases executions I always got this error. I found out, that my "Distributed Transaction Service" was not started (run: services.msc -> start "Distributed Transaction Service" (best to set it to start automatic)). After I did that, it worked like a charm...

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

    NONE of the answers worked for me

    I think that some of us all make silly mistakes, there are 100 ways to fail ...

    My issue was new project, I setup all the configuration in another project, but the caller was a Web Api project in which I had to copy the same connection string in the Web api project.

    I think this is crazy considering I was not even newing up dbcontext or anything from the web api.

    Otherwise the class library was trying to look for a Database named

    TokenApi.Core.CalContext   
    

    of which my project is named TokenApi.Core and the CalContext is the name of the connection string and the file name

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

    I had a similar issue with the SQL Server Express Edition on Windows Server 2003. I simply added the network service as a user in the database security.

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

    I had the same issue few days ago, using "Integrated Security=True;" in the connection string you need to run the application pool identity under "localsystem" Sure this is not recommended but for testing it does the job.

    This is how you can change the identity in IIS 7: http://www.iis.net/learn/manage/configuring-security/application-pool-identities

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

    In IIS set the App Pool Identity As Service Account user or Administrator Account or ant account which has permission to do the operation on that DataBase.

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