Thursday, July 9, 2009

How to read and Write XML Files in C#?

Typically, you use an XmlTextWriter if you need to write XML as raw data without the overhead of a DOM. The XmlTextWriter is an implementation of the XmlWriter class that provides the API which writes XML to file, stream, or a TextWriter. This class provides numerous validation and checking rules to ensure that the XML being written is well formed. When certain violations occur, exceptions are thrown and these exceptions should be handled. The XmlTextWriter has different constructors, each of which specifies a different type of the location to which to write the XML data. This sample uses the constructor that writes XML to a file. In particular, the following sample code constructs an XmlTextWriter with a string representing the file location for the newbooks.xml file.





Read more on Reading and Writing XML Files in C# at http://www.buzzycode.com/ShowArticles-id...

How to read and Write XML Files in C#?
http://www.codeproject.com/csharp/xmlcon...

quince

No comments:

Post a Comment