Cant find my EF code first database

后端 未结 1 1551
暗喜
暗喜 2020-12-11 07:32

I am doing Microsoft\'s MVC getting started tutorial:

Getting Started with Entity Framework 6 Code First using MVC 5.

This includes the creation of a code fi

相关标签:
1条回答
  • 2020-12-11 08:05

    You didn't specify the Initial Catalog in your connection string so probably you are using the Master database.

    You need to specify the Initial catalog like this:

    <add name="MovieDBContext" 
         connectionString="Data Source=.\SQLEXPRESS;Initial Catalog=yourDBName;Integrated Security=True" 
         providerName="System.Data.SqlClient"/>
    
    0 讨论(0)
提交回复
热议问题