Update DataSet structure in Visual Studio to match new SQL Database Structure
Asked Answered
T

1

33

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.

Threescore answered 29/2, 2012 at 10:50 Comment(0)
H
39

From the 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.

An addition: Use View > Other Windows > Data Source (Shift + Alt + D)

Hyperbole answered 29/2, 2012 at 10:55 Comment(5)
Thanks a lot, a great work of returning and improving quality of the answer for the community after passage of one year. Really appreciated and useful information.Squaw
What if I need to update the DataSet.xsd because I added not just some columns on some tables but some brand new tables or views?Faubourg
"Configure" option is disabled on my end. what to do?Handbill
Yup, same here.. "Configure" is disabled... I can delete the table, then re-add it from Server Explorer, but it loses all the relationships.Evalynevan
Same here, better late than never. Use: View > Other Windows > Data Source (Shift + Alt + D)Shontashoo

© 2022 - 2024 — McMap. All rights reserved.