.NETGURU
data set merge
Messages   Related Types
This message was discovered on ASPFriends.com 'aspngdata' list.


Jose Fuentes
-- Moved from [ngfx-sqlclient] to [aspngdata] by Yannick Smits <Click here to reveal e-mail address> --

WHen I do a merge of two datasets with the same table in each of them I get
the result of the orginal dataset.

Ok let me expline

dataset1.table1 has three fields id,name,state
dataset2.table1 has three fields id,name,state

now I want to merge dataset2 into data set1

dataset2.merge(dataset1)

now the values for dataset1
1,hi,fl

dataset 2
1,hi,ga

Now I expected to now have in dataset1
1,hi,ga
but I still have
1,hi,fl

if I do it the other way.
dataset1.merge(dataset2)
i get the same thing.

Any idea's?
Joe

Reply to this message...
 
    
Jason Zhu
Do you have primary key defined in these two tables? How many rows do
you get after the merge?
You might want to publish the code to show the issue you have.
Jason

-----Original Message-----
From: Jose Fuentes [mailto:Click here to reveal e-mail address]=20
Sent: Wednesday, July 10, 2002 9:16 AM
To: aspngdata
Subject: [aspngdata] data set merge

-- Moved from [ngfx-sqlclient] to [aspngdata] by Yannick Smits
<Click here to reveal e-mail address> --

WHen I do a merge of two datasets with the same table in each of them I
get
the result of the orginal dataset.

Ok let me expline

dataset1.table1 has three fields id,name,state
dataset2.table1 has three fields id,name,state

now I want to merge dataset2 into data set1

dataset2.merge(dataset1)

now the values for dataset1
1,hi,fl

dataset 2
1,hi,ga

Now I expected to now have in dataset1=20
1,hi,ga
but I still have
1,hi,fl

if I do it the other way.
dataset1.merge(dataset2)=20
i get the same thing.

Any idea's?
Joe
| [aspngdata] member Click here to reveal e-mail address =3D YOUR ID
| http://www.asplists.com/asplists/aspngdata.asp =3D JOIN/QUIT
| http://www.asplists.com/search =3D SEARCH Archives

Reply to this message...
 
    
Das
Read my article which talks about the same scenario as yours.
http://www.aspalliance.com/das/mergedatasets.aspx

Hope this helps,
Jesudas Chinnathampi (Das)

Co-Author - Beginning ASP.NET Databases using VB.NET
http://www.amazon.com/exec/obidos/ASIN/1861006195

Read my articles on ASP .NET at
http://aspalliance.com/das

----- Original Message -----
From: "Jose Fuentes" <Click here to reveal e-mail address>
To: "aspngdata" <Click here to reveal e-mail address>
Sent: Wednesday, July 10, 2002 12:16 PM
Subject: [aspngdata] data set merge

> -- Moved from [ngfx-sqlclient] to [aspngdata] by Yannick Smits
<Click here to reveal e-mail address> --
[Original message clipped]

Reply to this message...
 
    
Jose Fuentes
after setting the primary keys everything worked fine.
Thanks
Joe

-----Original Message-----
From: Jason Zhu [mailto:Click here to reveal e-mail address]
Sent: Thursday, July 11, 2002 2:47 AM
To: aspngdata
Subject: [aspngdata] RE: data set merge

Do you have primary key defined in these two tables? How many rows do
you get after the merge?
You might want to publish the code to show the issue you have.
Jason

-----Original Message-----
From: Jose Fuentes [mailto:Click here to reveal e-mail address]
Sent: Wednesday, July 10, 2002 9:16 AM
To: aspngdata
Subject: [aspngdata] data set merge

-- Moved from [ngfx-sqlclient] to [aspngdata] by Yannick Smits
<Click here to reveal e-mail address> --

WHen I do a merge of two datasets with the same table in each of them I
get
the result of the orginal dataset.

Ok let me expline

dataset1.table1 has three fields id,name,state
dataset2.table1 has three fields id,name,state

now I want to merge dataset2 into data set1

dataset2.merge(dataset1)

now the values for dataset1
1,hi,fl

dataset 2
1,hi,ga

Now I expected to now have in dataset1
1,hi,ga
but I still have
1,hi,fl

if I do it the other way.
dataset1.merge(dataset2)
i get the same thing.

Any idea's?
Joe
| [aspngdata] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngdata.asp = JOIN/QUIT
| http://www.asplists.com/search = SEARCH Archives

| [aspngdata] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngdata.asp = JOIN/QUIT
| http://www.asplists.com/search = SEARCH Archives

Reply to this message...
 
    
Alex Dresko
There are several versions of the DataSet.Merge method. The one you need
to use is:

public void Merge(DataSet, bool);

You want to pass false to the second parameter which will force the
merge to only include the current values of the dataset you're merging.

Alex Dresko
Three Point Oh!

-----Original Message-----
From: Jose Fuentes [mailto:Click here to reveal e-mail address]
Sent: Wednesday, July 10, 2002 12:16 PM
To: aspngdata
Subject: [aspngdata] data set merge

-- Moved from [ngfx-sqlclient] to [aspngdata] by Yannick Smits
<Click here to reveal e-mail address> --

WHen I do a merge of two datasets with the same table in each of them I
get
the result of the orginal dataset.

Ok let me expline

dataset1.table1 has three fields id,name,state
dataset2.table1 has three fields id,name,state

now I want to merge dataset2 into data set1

dataset2.merge(dataset1)

now the values for dataset1
1,hi,fl

dataset 2
1,hi,ga

Now I expected to now have in dataset1
1,hi,ga
but I still have
1,hi,fl

if I do it the other way.
dataset1.merge(dataset2)
i get the same thing.

Any idea's?
Joe
| [aspngdata] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngdata.asp = JOIN/QUIT
| http://www.asplists.com/search = SEARCH Archives

Reply to this message...
 
 
System.Data.DataSet




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification