hello folks,

I have one dataset that I have modified (update, insert, delete).
I also have another dataset that I just reload fresh from the database.
Both datasets come from the same table.

The idea with merge is to merge the modified dataset and new dataset
together with preserving the changes made to the old one.

When I do that, i got duplicate result instead of the merged one.


What did I do wrong?

-Agung

Re: Merge() confusion by Joyjit

Joyjit
Wed Aug 18 01:41:58 CDT 2004

Hi,

Try the Merge method with an optional second parameter, PreserveChanges. Set
it to true so that your changes in the first dataset will persist.

Regards
Joyjit

"Toni" <toni@wrongemailaddress.com> wrote in message
news:OURi5VMhEHA.216@tk2msftngp13.phx.gbl...
> hello folks,
>
> I have one dataset that I have modified (update, insert, delete).
> I also have another dataset that I just reload fresh from the database.
> Both datasets come from the same table.
>
> The idea with merge is to merge the modified dataset and new dataset
> together with preserving the changes made to the old one.
>
> When I do that, i got duplicate result instead of the merged one.
>
>
> What did I do wrong?
>
> -Agung
>
>



Re: Merge() confusion by Miha

Miha
Wed Aug 18 02:16:55 CDT 2004

Hi Toni,

To start with, do you have a primary key defined on DataTable being merged?

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
miha at rthand com
www.rthand.com

"Toni" <toni@wrongemailaddress.com> wrote in message
news:OURi5VMhEHA.216@tk2msftngp13.phx.gbl...
> hello folks,
>
> I have one dataset that I have modified (update, insert, delete).
> I also have another dataset that I just reload fresh from the database.
> Both datasets come from the same table.
>
> The idea with merge is to merge the modified dataset and new dataset
> together with preserving the changes made to the old one.
>
> When I do that, i got duplicate result instead of the merged one.
>
>
> What did I do wrong?
>
> -Agung
>
>