An exception of type 'System.Data.SqlClient.SqlException' - Microsoft Getting Started with ASP.NET MVC 5 Movie Website

后端 未结 2 832
长发绾君心
长发绾君心 2021-01-27 08:28

The error i\'m getting is An exception of type

\'System.Data.SqlClient.SqlException\' occurred in EntityFramework.dll but was not handled in user code.

相关标签:
2条回答
  • 2021-01-27 09:05

    Screenshot says that there is a problem between your application and sql server. Application cannot connect to the server. Possible reasons:

    1. Connection string values/format.
    2. No server or server down.
    3. Network problems.
    0 讨论(0)
  • 2021-01-27 09:09

    Your EF connection string is using the "old" (since VS 2015 if I'm not mistaken**) way of connecting to localdb. You can see your DefaultConnection using the "new" way.

    So:

    <add name="MovieDBContext" connectionString="Data Source=(LocalDB)\MSSQLLocalDB;...`
    

    Not: Data Source=(LocalDB)\v11.0...

    **Since SQL Server 2014 Express Local DB

    Hth...

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