将列添加到数据库-如何更新dbml文件? [英] Add column to the database - how do I update the dbml file?

查看:226
本文介绍了将列添加到数据库-如何更新dbml文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么方法可以刷新dbml文件,还是必须删除它并生成一个全新的文件?

Is there a way I can refresh the dbml file or do I have to delete it and generate a whole new one?

推荐答案

据我所知,设计器中没有内置功能可以通过数据库中的更改来更新表.

So far as I know there's no built-in functionality in the designer to update a table with changes in a database.

有第三方工具( http://www.huagati.com/dbmltools/ ),提供了这种功能.

There are third party tools (http://www.huagati.com/dbmltools/) that offer that sort of functionality.

每当遇到此问题时,它就位于已设置多个手动关系的表的一两列的顺序上,因此我只编辑了XML(右键单击DBML并选择打开-> XML")并将这些列添加到表定义中.

Whenever I ran into this issue it was on the order of one or two columns on a table with multiple manual relationships already set up, so I just edited the XML (right click on the DBML and select open with -> XML) and added the columns to the table definition.

保存DBML文件后,关联的.designer.cs文件将自动使用新添加的列的代码进行更新.因此,无需在设计器模式下删除和重新创建表.

When DBML file is saved the associated .designer.cs file is automatically updated with code for newly added columns. Therefore, there is no need to drop and recreate table in designer mode.

这篇关于将列添加到数据库-如何更新dbml文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆