与&QUOT自动创建表;更新数据库.."从型号不起作用 [英] Auto-creating tables with "update-database.." from Model does not work
问题描述
我在ASP.NET MVC编程是新的,我也跟着教程<一个href=\"http://pluralsight.com/training/Player?author=scott-allen&name=aspdotnet-mvc5-fundamentals-m6-ef6&mode=live&clip=0&course=aspdotnet-mvc5-fundamentals\"相对=nofollow>实体框架6从Pluralsight 。
I am new in ASP.NET MVC programming and i have followed the tutorial "Entity Framework 6" from Pluralsight.
我目前坚持多迁移一节。他说,命令
I am currently stuck at the "Multiple Migration" section. He says that the command
update-database -ConfigurationTypeName Books.Web.DataContexts.IdentityMigrations.Configuration
在包管理器控制台会自动创建在服务器资源管理器表。但是,这是行不通的。我得到这样的错误:
in the package-manager-console will automatically create tables in the Server Explorer. But it does not work. I get the an Error like this:
网络相关的或实例特异的错误,而与SQL Server建立连接时出现。服务器没有被发现,或者无法访问它。检查实例名称是否正确,以及SQL Server允许远程连接。错误:50 - 错误在本地数据库中运行。指定的LocalDB实例不存在。
Network related or instance -specific error occurred while establishing a connection to SQL Server . The server was not found , or can not access it . Check if the instance name is correct and that SQL Server allows remote connections. Error: 50 - Error in the Local Database Runtime. The specified LocalDB instance does not exist.
我看过的类似问题的其他问题,但我没能解决它。
I have read other questions with the similar problem but I was not able to fix it.
推荐答案
这真的听起来要么A)你没有一个数据库服务器运行,或者您没有连接到服务器或B)在您的连接字符串您web.config中是错误的。
This really sounds like either A) You don't have a DB server running or you aren't connected to the server or B) Your connection string in your web.config is wrong.
这篇关于与&QUOT自动创建表;更新数据库..&QUOT;从型号不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!