RE: Dataset.merge method
From: mklapp (mklapp_at_discussions.microsoft.com)
Date: 10/05/04
- Next message: mklapp: "RE: Using Data Access Logic Components"
- Previous message: Jon Skeet [C# MVP]: "Re: DateTime"
- In reply to: Jared: "Dataset.merge method"
- Next in thread: Jared: "Re: Dataset.merge method"
- Reply: Jared: "Re: Dataset.merge method"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 5 Oct 2004 07:27:01 -0700
The behavior of each row in the ds to be merged (the one between the parens,
not the 'owner' of the method) depends on the Row State. Unchanged, Modified
and Deleted are matched on primary keys. Added rows are simply added to the
table.
"Jared" wrote:
> Hello all,
> I am trying to merge a datarow (dataset, datatable, etc.) with values
> from my database with another one that is filled with values from my active
> directory database and merge the two together with the values from active
> directory taking precedence. I have never used the merge method before and I
> am having a bit of trouble.
>
> I have two dataset objects
> ds - dataset containing a single datatable object and a single row
> ADds - same as ds
>
> the schema is exactly the same as I have used ds.tables(0).clone to create
> ADds' datatable and used the newrow function of ADds to populate my data
> from AD.
>
> This is where I'm having problems. I am currently using
> ADds.Merge(ds,False), but the resulting dataset contains only the data from
> ADds, can someone please point me in the right direction. I would prefer not
> to loop through the datasets if at all possible, either way I would like to
> know how the merge method is used (documentation only show the
> missingschema.add variation). There is a primary key column set, and If
> memory serves correctly, when I use the clone method my key column should
> remain (which looks to be supported by the traces that I've run).
>
> TIA,
> Jared
>
> Original DS Values (Database)
> 123456789
> My messed up display name
> Jared
> MyLastName
> Q
> jared
> jared
> <null>
> <null>
>
> Merged DS Values (AD)
> 123456789
> A good display name
> Jared
> AGoodLastName
> <null>
> Jared
> jared@mydomain.com
> 987654321
> 555-1212
>
> for a combined value of:
>
> 123456789
> A good display name
> Jared
> AGoodLastName
> Q
> Jared
> jared@mydomain.com
> 987654321
> 555-1212
>
>
>
- Next message: mklapp: "RE: Using Data Access Logic Components"
- Previous message: Jon Skeet [C# MVP]: "Re: DateTime"
- In reply to: Jared: "Dataset.merge method"
- Next in thread: Jared: "Re: Dataset.merge method"
- Reply: Jared: "Re: Dataset.merge method"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|