Solved

c# XML file best approach

Posted on 2011-09-15
4
256 Views
Last Modified: 2012-05-12
HI,

I have made an c# app that gets data from a database and creates an XML file and puts the data in that XML file.

I want to know whats the best/fastest approach to take as there can be over 10,000-20,000 records to take at once.

Thanks,

R8VI
0
Comment
Question by:R8VI
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 26

Accepted Solution

by:
Shaun Kline earned 500 total points
ID: 36545833
If you do not need to manipulate the data (such as column names) when the XML file is created, consider using the WriteXML method on the data table object: http://msdn.microsoft.com/en-us/library/system.data.datatable.aspx
0
 
LVL 16

Expert Comment

by:Easwaran Paramasivam
ID: 36547251
Yes. Above said is correct one. We have one more option.

From the sql itself you can return XML as output. Just write the output in a XML file.
http://msdn.microsoft.com/en-us/library/ms178107.aspx

Explicit option will allow to specify your xml format. You have control on the format that you need.
0
 
LVL 16

Expert Comment

by:Easwaran Paramasivam
ID: 36547253
0
 
LVL 2

Expert Comment

by:i0nutz
ID: 36549035

You should get the XML from the DB and then do Streaming read of a such large XML file.
Please see this link where you have a sample code for this:
http://stackoverflow.com/questions/45481/how-to-do-streaming-read-of-a-large-xml-file

Hope this will help you.
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
asp.net mvc 2 34
Running ftp server and transfering data to the path using Windows Service 6 38
Google Maps with Webforms 1 29
Return array 3 20
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question