Solved

Controlling the order data is saved in a DataSet

Posted on 2013-06-28
2
306 Views
Last Modified: 2013-07-04
I've got a number of tables in my DataSet, but I can't seem to control the order they are saved in, and sometimes this results in foreign key errors.

There are lots of useful tips about using DataSets - for example here:

http://www.dotnetperls.com/dataset

but I can't find how to ensure one table is saved first to fix this problem. Can anyone point me in the right direction here?
0
Comment
Question by:purplesoup
2 Comments
 
LVL 40

Accepted Solution

by:
Jacques Bourgeois (James Burger) earned 500 total points
ID: 39285238
Do not Update the DataSet. Update the individual tables, in the proper order. The mechanism for tables is the same as for a DataSet.
0
 

Author Comment

by:purplesoup
ID: 39299367
ok thanks - well it turns out after some investigation that with foreign keys we had code to check the relations between the tables and update consistently, but somehow bad data was getting into the DataSet which lost the relations - so yes, the answer is to update the tables individually in the proper order.
0

Featured Post

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question