DataSet Merge

  • Thread starter msnews.microsoft.com
  • Start date
M

msnews.microsoft.com

I have two datasets loaded at different points in time with the same schema.

When I merge the two datasets with preserve changes set to true all the rows
in the target dataset have their rowstate set to modified even though the
original and current values for both datasets are the same.

Is there a way to get the merge operation to only change the rowstate if
the original and or current values are different?

Frank
 
K

Kevin Yu [MSFT]

Hi Frank,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that you need to get the merge operation to
only change the rowstate if the original and or current values are
different. If there is any misunderstanding, please feel free to let me
know.

As far as I know, this cannot be achieved using DataSet.Merge method if
both DataSets contains changes. If we set the preserveChanges to false, the
changes of the target DataSet is lost. If we set preserveChanges to true,
the RowState for rows in the target DataSet will be set to Modified. This
is by design.

HTH. If anything is unclear, please feel free to reply to the post.

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

msnews.microsoft.com

Yes, you understand my issue. If preserve changes is true and the original
and current values are the same. how is a rowstate of modified valid. What
has been modified?

Note: by "original and current values are the same" i mean dataset1.original
= dataset2.original & dataset1.current = dataset2.current

Does the merge operation update the orginal values in the target dataset
without first checking to see if they are different? (when preserve changes
is true)

Frank
 
K

Kevin Yu [MSFT]

Hi Frank,

As I mentioned that this behavior is by design in my last post, I'm not
quite sure if the merging process compares the value in the DataSet,
because this relates with the implementation. I'm afraid we have to
consider other methods to achieve your goal. Sorry for the inconvenience.

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top