Entity Framework The underlying provider failed on Open

后端 未结 19 1949
挽巷
挽巷 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:48

    Always check for Inner Exception if any. In my case Inner Exception turned out to be really helpful in figuring out the issue.

    My site was working fine in Dev Environment. But after i deployed to production, it started giving out this exception, but the Inner Exception was saying that Login failed for the particular user.
    So i figured out it was something to do with the connection itself. Hence tried logging in using SSMS and even that failed.

    Eventually figured out that exception showed up for the simple reason that the SQL server had only Windows Authentication enabled and SQL Authentication was failing which was what i was using for Authentication.

    In short, changing Authentication to Mixed(SQL and Windows), fixed the issue for me. :)

提交回复
热议问题