?
Solved

c# XML file best approach

Posted on 2011-09-15
4
Medium Priority
?
260 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 2000 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

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 …
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

752 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