0
我一直在尝试通过代码优先迁移来尝试使用SQL Server数据库。对于我的最新尝试,我:在ASP.NET MVC 4中使用SQL Server数据库进行代码优先迁移
- 创造了一个新的ASP.NET MVC 4 Web应用程序项目(是的,我想用这个模板)
- 创建的模型实体
- 创建继承数据上下文类从的DbContext
放置在Web.config下面的连接字符串驻留在应用程序的根:
add name="DefaultConnection" connectionString="Data Source=.\sqlexpress;Integrated Security=true;Initial Catalog=DatingAnAsianWoman;MultipleActiveResultSets=true;providerName=System.Data.SqlClient"
在PAC卡格经理我输入:
Enable-Migrations -ContextTypeName UsersContext
其次:
Update-Database
在这一点上我收到以下错误:
The connection string 'DefaultConnection' in the application's configuration file does not contain the required providerName attribute."
我希望得到任何帮助都。