Overwriting Files
When program EditXml calls the DataSet’s WriteXml method, that method writes all the DataSet’s data into the XML file, overwriting any information that was already there. This is one of the most important differences between XML files and true databases. In a relational database, you can update a single record without modifying the rest of the database’s contents. When you modify XML data, you must rewrite the entire XML file.
This makes building a multi-user application with XML difficult. Suppose two users start the application at the same time and they both make changes. The first user saves his changes, overwriting the original XML file, then the second user saves his changes, overwriting the XML file again. The first user’s ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access