简体   繁体   English

如何在不删除数据库的情况下更改模型?

[英]How can I change the model without having to delete the database?

If I make any change in the model, now I have to delete and recreate the database. 如果我在模型中进行任何更改,现在我必须删除并重新创建数据库。 What do I resolve? 我该怎么解决?

Make changes in database manually. 手动更改数据库。 Make sure you have Prevent saving changes that require table re-creation unchecked in Options under Designers in SQL Server Management Studio 确保在SQL Server Management Studio中的“设计器”下的“选项”下取消选中Prevent saving changes that require table re-creation

在此输入图像描述

You will need to make the alterations to the database manually. 您需要手动更改数据库。

There are automated tools to help you with reflection such as http://visualstudiogallery.msdn.microsoft.com/df3541c3-d833-4b65-b942-989e7ec74c87 or http://www.huagati.com/dbmltools/ 有一些自动化工具可以帮助您进行反思,例如http://visualstudiogallery.msdn.microsoft.com/df3541c3-d833-4b65-b942-989e7ec74c87http://www.huagati.com/dbmltools/

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在不访问原始项目的情况下删除项目? - How can I delete a project without having access to the original project? 在.NET Web应用程序中,如何在无需托管自己的SQL数据库的情况下实现成员资格? - In a .NET web app, how can I implement Membership without having to host my own SQL database? 如何在不更改路由的情况下将参数从视图传递到控制器 - How can I pass a parameter from a view to a controller without having to change the routing 我可以在不更改模型的情况下触发重新种子吗? - Can I trigger a re-seed without a model change? 如何在数据库中使用 model 这个 class? - How can I model this class in a database? 是否可以从Server Explorer将SQL视图导入模型中而不必自己编写类? - Can I import a SQL View from Server Explorer into my Model without having to write the class myself? 我如何在DataContext中更改数据库名称 - How I can change the database name in DataContext 如何使用LINQ-to-SQL更新表而不必删除所有现有记录? - How do I update a table with LINQ-to-SQL without having to delete all the existing records? 更新实体数据模型时,如何在不更改的情况下继续在类中使用 System.ComponentModel.DataAnnotations? - How can I keep using System.ComponentModel.DataAnnotations in class without change when updata Entity data model? 如何在 Mvc 核心中回滚对数据库的插入或删除 - How can I roll back insert or delete on database in Mvc core
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM