473,668 Members | 2,371 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.GetChan ges(DataRowStat e.Deleted) and
DataSet.GetChan ges(DataRowStat e.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 1960
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
1604
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 field will need to do remote updates both receiving and submitting data back to the main office. I can't just make it a live web app because the users will have to be able to work off line and sync data later (presumably with a VPN connection). ...
1
2427
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 causes the sync to work. Seeking to position 0 before the sync doesn't seem to help. If you look at sync() as simply invalidating the read buffer (isn't that right?), isn't it illogical for it to fail in this situation? Besides sync()...
2
6334
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...)). <---- Common Virtual IP Addr ----> MASTER (working) BACKUP (standby)
7
2056
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 / pointers on keeping the DDL's in sync with each other. I'm going to have a development machine in my office that I first apply any schema / stored-procedure changes to, then would like to roll out
5
5657
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 the PC and with a widest target platform (ie. XP home, so no IIS), therefore using IIS for Sync is not really an option (?) Thanks
3
2963
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 for Item (this)? Normally,do I need sync at all? Isn't that true without sync the program can run faster?
7
9698
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 the sync version of the socket should be the easiest - or what??? (please tell if I'm wrong). Are there anyone who is able to point to a Server and Client example code in C# VS2005 (I've only been able to find a C++ version) ???
7
5208
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 from the real source - and that is not always possible or desirable. Consequently, sync() returns 0 if it succeeded. If it failed, it sets ios_base::badbit (21.3.3) and returns -1. Again, setting badbit might trigger an exception (21.3.6). A sync()...
29
3303
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 use it in sync mode. Any ideas what can I do? Thanks, Zalek.
2
1465
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 it several times in a row, and it will post several concurrent XHRs ... http://preview.tinyurl.com/5eu3ll
0
8381
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8893
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8586
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8658
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6209
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4205
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4380
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2026
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1786
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.