Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Append to an XML file
Message
From
01/12/2005 13:44:14
Keith Payne
Technical Marketing Solutions
Florida, United States
 
General information
Forum:
ASP.NET
Category:
XML
Miscellaneous
Thread ID:
01073740
Message ID:
01073869
Views:
13
>Writing a dataset to an XML file is a trivial task, but is it possible to append to an existing XML file?
>
>Einar

It is not possible to append to an existing file directly. Assuming that you want to add more rows from the dataset to the XML file, you can load the existing XML file into an XmlDocument or XmlDataDocument, then append an XML fragment of the new rows to the collection that contains the rows.

However, it is better from a design standpoint to load the existing XML into a dataset, then merge the rows into the dataset and re-serialize the whole thing. By doing it this way, you can be certain that no constraints are being violated and that the resulting xml file can be re-loaded into a dataset.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform