Solved

c# XML file best approach

Posted on 2011-09-15
4
257 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

How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

Question has a verified solution.

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

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
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.
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

707 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