gpt4 book ai didi

c# - 更新 Visual Studio 中的数据集结构以匹配新的 SQL 数据库结构

转载 作者:IT王子 更新时间:2023-10-29 04:27:27 24 4
gpt4 key购买 nike

在对我的 SQL 数据库结构进行一些更改后(使用 SQL Server Management Studio 中的脚本),我如何在 Visual Studio 中更新我的 DataSet.xsd 文件以匹配新结构?我必须手动执行此操作吗?
我考虑过删除数据集并导入一个新数据集,但我会丢失所有自定义表适配器查询。

最佳答案

来自MSDN Forums :

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.

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.

关于c# - 更新 Visual Studio 中的数据集结构以匹配新的 SQL 数据库结构,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9497689/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com