partial merge? - 05-12-2007 , 03:19 PM
I'm using DataTable.Merge() to merge values from a source DT into a
destination DT which are in seperate Datasets.
The source DT has columns A,B,C and the destination DT has columns A,B,D.
column A is primary key for both of them. So, basically, my target is to
copy all the values from column B in the source DT to column B in the
destination DT. So far so good (Merge with MissingSchemaAction.Ignore does
However, The source DT has 1000 rows and the destination DT has 50 rows. The
Merge action copy all the 1000 rows into the destination DT, where I'm only
interested in updating the existing 50 rows in the destination DT. (Just
update, no Insert). From what I've read, if merge doesn't find a
corresponding PK it adds the new rows.
Is there any way to go around this with merge? any other way, without using
merge? (I tried to save looping over all the rows in one DT and locating them
in the other one)
Thanks in advance
RE: partial merge? - 05-14-2007 , 11:43 AM
try merge with MissingSchemaAction.AddWithKey
Hope this helps
Thanks and Regards.
MCP and MCTS.
|Thread Tools||Search this Thread|