Cannot find my Entity Framework database

后端 未结 3 767
梦毁少年i
梦毁少年i 2021-01-14 21:27

I am a little confused on the code first entity framework database.

I created a new DbContext and class that I will be storing in that context, like this:

         


        
3条回答
  •  清歌不尽
    2021-01-14 22:06

    You need to set your database server as (LocalDB)\MSSQLLocalDB. This is a change made to EF 6.1.1 onwards. The MSSQLLocalDB is mentioned in your parameter. More details on the change can be found here https://entityframework.codeplex.com/workitem/2246

    MSSQLLocalDB is the default instance name on SQL Server 2014 whereas v11.0 is the default Instance name on SQL Server 2012

提交回复
热议问题