ReadXML Dataset - Original Rows, RowState = Added (not Unchanged)

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I realize the original quesiton was dealt with but this appeared to be the
most appropriate thread to post my question under. Here is my senario:



1) Connect to DB

2) Fill DataSet with tables, set Relationships, Constraints

3) Save DataSet to file

4) Send DataSet (and additional support files to client from Web Service)

5) Open Dataset (from file) in Client App



My problem lies in the fact that once the DataSet is saved to file and
then reloaded from the file all RowState values change to "Added" even though
no rows have been modified/deleted/added.



How can I keep the RowState from changing for the original DataRows that
have not been modified by the ClientApp?
 
Hi
THis solution would need to be verified as I have not worked it through.

After you Open the DataSet from file you need to call the AcceptChanges
method which should reset the RowState.

The problem you then have is if the Client makes changes to the DataSet
saves it to file, then loads it again as you then don't know what are the
real changes.

The answer to this is I think that when the client saves the file, save it
as a different file using the DiffGram format.

Then when you load the DataSet again you first read the original file and
AcceptCahnges the read the DiffGram which has your clients changes.

I think that should work, although somebody maybe able to come up with a
simpler solution. Let me know if that works.

Regards

Phil
 
Back
Top