Best approach to write huge xml data to file?

Posted by Kayes on Stack Overflow See other posts from Stack Overflow or by Kayes
Published on 2010-04-20T06:43:28Z Indexed on 2010/04/20 8:03 UTC
Read the original article Hit count: 283

Filed under:
|
|
|

Hi. I'm currently exporting a database table with huge data (100000+ records) into an xml file using XmlTextWriter class and I'm writing directly to a file on the physical drive.

_XmlTextWriterObject = new XmlTextWriter(_xmlFilePath, null);

While my code runs ok, my question is that is it the best approach? Or should I write the whole xml in memory stream first and then write the xml document in physical file from memory stream? And what are the effects on memory/ performance in both cases?

© Stack Overflow or respective owner

Related posts about c#

Related posts about Xml