473,666 Members | 2,080 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

dataset merge

Hi,
I have an original dataset. It is copied to 2 different forms. Each form
adds a new row to the same table in that dataset. When I merge these 2
dataset back to original one, the 2 new rows merge to one!
My question is how I can still keep them as 2 rows in that table, not merge
to one?

Thanks.

Li

Jul 21 '05 #1
3 1651
Hi Li,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that you need to merge the two DataSets with
to one and keep the additional rows in both DataSets. If there is any
misunderstandin g, please feel free to let me know.

According to your description, I believe the DataSets are strong typed with
key information. So when merging, the two new added rows are recognized as
identical row and discard the changes in one DataSet you made.

So with the key information, it is impossible for us to merge the two
DataSets correctly using DataSet.Merge directly. However, you can try the
following steps for a walkaround.

1. Remove the primary key information in the destination DataSet.
2. Use DataSet.GetChan ges(DataRowStat e.Added) to get the added rows in the
source DataSet.
3. Then use DataSet.Merge on the destination DataSet to merge data.

HTH.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Jul 21 '05 #2
Thanks, Kevin.

Li

"Kevin Yu [MSFT]" wrote:
Hi Li,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that you need to merge the two DataSets with
to one and keep the additional rows in both DataSets. If there is any
misunderstandin g, please feel free to let me know.

According to your description, I believe the DataSets are strong typed with
key information. So when merging, the two new added rows are recognized as
identical row and discard the changes in one DataSet you made.

So with the key information, it is impossible for us to merge the two
DataSets correctly using DataSet.Merge directly. However, you can try the
following steps for a walkaround.

1. Remove the primary key information in the destination DataSet.
2. Use DataSet.GetChan ges(DataRowStat e.Added) to get the added rows in the
source DataSet.
3. Then use DataSet.Merge on the destination DataSet to merge data.

HTH.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Jul 21 '05 #3
You're welcome, Li.

Thanks for sharing your experience with all the people here. If you have
any questions, please feel free to post them in the community.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Jul 21 '05 #4

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

Similar topics

8
749
by: Bruce Stockwell | last post by:
the setup: Webservice/WinClient application/SQL server. VS.Net (visual basic) winform wizard creates a simple form with load cancel cancelall and datagrid bound to a simple Dataset with one Datatable. No coding by programer, All wizardry. User starts app, opens form, adds (4) records and clicks update.
2
4292
by: Mike Stephens | last post by:
A contact management application we previously developed for a customer now has a requirement to perform mail merging. Normally request like this would be very simple to solve, we were just point the mail merge data source to the database. But this request is a little bit different. The customer needs to perform the mail merge from the contacts in a dataset. Example In the main contact window the client has the ability to filter contact...
3
418
by: Li Weng | last post by:
Hi, I have an original dataset. It is copied to 2 different forms. Each form adds a new row to the same table in that dataset. When I merge these 2 dataset back to original one, the 2 new rows merge to one! My question is how I can still keep them as 2 rows in that table, not merge to one? Thanks. Li
2
2103
by: muntyanu | last post by:
Hi all, I have problem when merging existing DataTable into new dataset. DataSet ds = new DataSet(); while ( done ) { // fill myCustomDataSet.MyTable with data ds.Merge( myCustomDataSet.MyTable, bPreserveChanges, MissingSchemaAction.Add ); ds.AcceptChanges(); // tried with and without this line
4
2246
by: Al | last post by:
I have this scenario: 1. XML file with schema and data is created from SQL Server tables. XML file contains 6 tables, some of them have rows, some of them are empty. 2. XML file is given to the person with Pocket PC. 3. XML file is used to populate DataSet on the Pocket PC. 4. User adds new rows, changes values, deletes some rows. 5. Altered dataset is saved back to XML file. 6. XML file is given back to the person who initially created...
1
2526
by: matt | last post by:
hello, i have a web app that allows users to query our oracle db and produce a dataset of report data. they then have the option to serialize this data and store it in the database. later, then can re-run the report and get fresh data. now, they would like to be able to compare the fresh data to the stored data, getting a break-down of added/deleted/changed rows. on the surface, this sounded plausible -- by deserializing the stored
5
16704
by: Mark Chambers | last post by:
Hi there, Can anyone explain the following (very) simple scenario. 1) I make an exact copy of my "DataSet" and delete one record from a given table (in the copy) 2) I invoke "DataSet.GetChanges()" on the above copy and pass the results to "DataSet.Merge()" on the original copy 3) If I now inspect the original copy, it shows that the record has *not* been deleted from the table. However, a call to "GetChanges()" does show my
2
1853
by: Neil Chambers | last post by:
I am trying to get my head around dataset merging but despite a little research I could still use a pointer (or ten). Basically I want to perform an outer join operation on a dataset (created from a file operation) and the resulting sql query based on the contents of said dataset. Effectively I would end up with two dataset tables in my application. If I were writing this to action from two tables it would be thus: SELECT ds.id, db.*
1
6170
by: joproulx | last post by:
Hello all, Here is my problem: I am trying to merge 2 datasets but I don't want to overwrite rows that are already modified in my working dataset. Example: I have one Dataset with only one DataTable in it. The DataTable has these 2 columns: Column #1: Name="Id" Type=Int32 (Primary Key)
0
8445
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8356
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
8781
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7386
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6198
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
5664
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2771
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2011
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1776
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.