472,984 Members | 2,311 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,984 software developers and data experts.

How to sync-up DataSet during multi-table update

When performing a parent-child table updates using DataAdapters, the
updates have to be performed in at least two passes. The deletes must
be done child first, then parent. Conversely, the inserts must be done
parent first, then child. This is generally accomplished by using
DataSet.GetChanges(DataRowState.Deleted) and
DataSet.GetChanges(DataRowState.Inserted) respectively.

My question is: What is the best way after this to sync up the
original DataSet with what was actually done by the database stored
procedure? For example, if a primary key was generated for the
inserted data?

When you update the source DataSet directly, the DataAdapter (at least
SqlDataAdapter) automatically updates the temporary primary keys with
the new primary keys.

I have tried to use DataSet.Merge, but that does not update the
original rows - it just appends the inserts so that now I have twice as
many new rows.

What is the best practice?

Jul 22 '05 #1
1 1930
No responses yet? Where are all the MS gurus? Certainly this must be
a common problem.

Jul 22 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

by: Jake Jessup | last post by:
I am just beginning development of a new app and I need a little advice on the best way to go about doing something. The app is a project management tool for a construction company. Users in the...
by: kartik | last post by:
I open an fstream in read-only mode, read till the end, then try to sync() before seeking to position 0 & reading again. But the sync fails. I discovered that clear()ing the stream before the sync...
by: M.L. | last post by:
Hello, I have two db2 box here, running a vrrp daemon to provide IP failover... The two nodes are perfectly identical (same os, users, and db2 setup (instances, db, tables...)). <----...
by: BarryS | last post by:
Hi All: We're rolling out 3 DB2 (8.2 on LUW) platforms for branch offices, each of these are going to have the same schema. These are all going to be non-federated systems. I need some advice...
by: Paul Aspinall | last post by:
Can anyone provide any pointers or code examples for Coding an app to use ActiveSync to sync between SQL CE and SQL 2000 / MSDE I want the app to use ActiveSync and to be a Windows form app on...
by: Ryan Liu | last post by:
Hi, What does ArrayList.Synchronized really do for an ArrayList? Is that equal to add lock(this) for all its public methods and properties? Not just for Add()/Insert()/Remvoe()/Count, but also...
by: Ole | last post by:
Hi, I'm going to develop a socket communication between an instrument (running CE 5.0 with Compact Fraework V2) and a PC. As the instrument should only connect to one PC at a time I believe that...
by: john | last post by:
I am reading TC++PL3 and on page 644 it is mentioned: "Flushing an istream is done using sync(). This cannot always be done right. For some kinds of streams, we would have to reread characters...
by: zalek | last post by:
I am writing application with Ajax in sync mode - xmlHttp.open("GET", url, false). I noticed that in FireFox handler doesn't starts. It starts when I use xmlHttp.open("GET", url,true). I need to...
by: Jorge | last post by:
Either a synchronous call isn't what I believe it to be, or there's a bug in FF3 : IOW : Why does the onclick handler of the button "SYNC" return (in FF3) before the XHR has completed ? Click...
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.