Sharing Data Saved As XML From a Dataset

  • Thread starter Thread starter Phil Galey
  • Start date Start date
P

Phil Galey

If using ReadXML and WriteXML to serialize a dataset instead of using a
regular database, is it still possible to avoid the problem of one person
overwriting another person's changes...or is it not possible for data
serialized as XML from databset to be shared? Thanks.
 
Even if the data is being loaded from an XML files you have the same issue
of someone overwriting someone else's data. Person1 and Person2 both load
the data. Person1 makes a change and saves, Person2 makes a different change
and saves, overwriting whatever Person1 did.

All you are doing is using a different method for storing data. You still
have the problem of multiple users on the system.

Unless you are talking about something else, in which case you need to make
the question more clear.
 
Not sure what you are asking. Once the dataset is serialized to Xml, it is
just like any other Xml file and offers no level of native protection
between writes.
Andrew Conrad
Microsoft Corp
 
Ok. Thanks. I was hoping that synchronizing by using an XmlDataDocument
might help by automatically keeping current the contents of dataset loaded
from an XML file if a separate process makes a change to the data in the XML
file while the dataset is open. Nothing like that, huh?
 
Phil,

Give the XML dataset a filename that contains the username

I hope this helps,

Cor
 
Note - for write scenarios, the DataSet/ XmlDataDocument is not thread safe.

I think another solution to your scenario might be to make seperate copies
of the dataset and left seperate processes modify the data independently.

Then use the DataSet merge capabilities to reconcile the differences.

Andrew Conrad
Microsoft Corporation
 
Back
Top