473,408 Members | 2,734 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

How to sync-up DataSet during multi-table update

PV
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 1945
PV
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

1
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...
1
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...
2
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...)). <----...
7
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...
5
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...
3
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...
7
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...
7
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...
29
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...
2
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.