MSSQL Error 'The underlying provider failed on Open'

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

    context.Connection.Open() didn't help solving my problem so I tried enabling "Allow Remote Clients" in DTC config, no more error.

    In windows 7 you can open the DTC config by running dcomcnfg, Component Services -> Computers -> My Computer -> Distributed Transaction Coordinator -> Right click to Local DTC -> Security.

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

    The SQL Server Express service were not set tostart automatically.

    1) Go to control panel 2) Administrative Tools 3) Service 4) Set SQL Server express to start automatically by clicking on it 5) Right click and start the service

    I hope that will help.

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

    I posted a similar issue here, working with a SQL 2012 db hosted on Amazon RDS. The problem was in the connection string - I had "Application Name" and "App" properties in there. Once I removed those, it worked.

    Entity Framework 5 and Amazon RDS - "The underlying provider failed on Open."

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

    You could try to replace the metadata:

    metadata=res:///conString.csdl|res:///conString.ssdl|res://*/conString.msl

    to:

    metadata=res://*/;

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

    For me it was just a simple mistake:

    I used Amazon EC2, and I used my elastic IP address in the connection string, but when I changed IP addresses I forgot to update my connection string.

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

    I found the problem was that I had the server path within the connection string in one of these variants:

    SERVER\SQLEXPRESS
    SERVER
    

    When really I should have:

    .\SQLEXPRESS
    

    For some reason I got the error whenever it had difficulty locating the instance of SQL.

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