更新数据集的结构在Visual Studio,以配合新的SQL数据库结构 [英] Update DataSet structure in Visual Studio to match new SQL Database Structure

查看:217
本文介绍了更新数据集的结构在Visual Studio,以配合新的SQL数据库结构的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

作出一些改变我的SQL数据库结构后(使用SQL Server Management Studio中的脚本),我怎么可以更新在Visual Studio我DataSet.xsd文件以匹配新的结构呢?我必须这样做手工?
我考虑删除的数据集和导入一个新的,但我会失去我的所有的自定义表适配器查询。

After making some changes to my SQL database structure (using scripts in SQL Server Management Studio), how can I update my DataSet.xsd file in Visual Studio to match the new structure? Must I do this manually?
I considered deleting the DataSet and importing a new one, but I'll lose all my custom Table Adapter queries.

推荐答案

也许你的问题已经回答了<一href="http://social.msdn.microsoft.com/Forums/en-US/winformsdatacontrols/thread/95d5b943-3641-4955-acac-287d21760d4f">here在http://social.msdn.microsoft.com/Forums

Probably your problem has been answered here at http://social.msdn.microsoft.com/Forums

编辑:我意识到刚才说这是/是一个非常贫穷的答案。好了,在那个时候,我就在这个网站真正的初学者。所以,我更新我的答案现在在这里复制链接上面

I realize just now that this was/is a very poor answer. Well, at that time, I was a real beginner in this site. So I update my answer now copying here the relevant content of the link above

如果您用鼠标右键单击的TableAdapter的数据集设计,然后点击   配置TableAdapter配置向导打开,您可以   重新定义你的表的架构主查询。本   应该让更多的TableAdapter查询(附加   方法)初始配置之后添加的。

If you right-click the TableAdapter in the Dataset Designer and click 'Configure' the TableAdapter Configuration Wizard opens where you can reconfigure the main query that defines the schema of your table. This should leave the additional TableAdapter queries (the additional methods) that were added after initial configuration.

。当然,另外的方法将还需要重新配置,如果他们引用已被从表中删除的一列   数据库,或者如果任何列定义变化的(例如,如果   该数据类型被改变或修改的)。因此,如果一个aditional的柱   添加到表,并允许空值的现有方法   应该还是工作 - 只是依靠变化的范围,架构   该表在数据库中的

Of course the additional methods will also need to be reconfigured if they reference a column that has been removed from the table on the database, or if any of the column definitions change (for example, if the data type is changed or modified). So if an aditional column was added to the table and it allows Null values the existing methods should still work - just depends on the scope of change to the schema of the table in the database.

我想在这里也报道了aswerer的名字,却是没有。

I wish to report here also the name of the aswerer, but there is none.

这篇关于更新数据集的结构在Visual Studio,以配合新的SQL数据库结构的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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