Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Append to an XML file
Message
De
01/12/2005 13:44:14
Keith Payne
Technical Marketing Solutions
Floride, États-Unis
 
Information générale
Forum:
ASP.NET
Catégorie:
XML
Divers
Thread ID:
01073740
Message ID:
01073869
Vues:
12
>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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform