473,388 Members | 1,382 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

Improving performances reading a XML into a DataSet

Dev
Good Morning to all,

I have a bunch of XML files that need to be readed inside the same DataSet
(each XML represent a single table).

In the event of a large (some megabytes) file, what is the best practice to
read them into the DataSet via the ReadXML() method?

Thanks, sorry for my newbie-hood

Dev
Nov 16 '05 #1
3 2214
Dev,

There really isn't more than one way to do this. You are going to get
the best performance by using the ReadXml method, which uses streams and/or
readers to read the data. That's the best you could do.

Unless you need to keep all of this in memory, you might want to look at
processing the stream using an XmlReader. This would avoid all that
overhead of keeping it in memory.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Dev" <no******@sorry.com> wrote in message
news:eh**************@TK2MSFTNGP10.phx.gbl...
Good Morning to all,

I have a bunch of XML files that need to be readed inside the same DataSet
(each XML represent a single table).

In the event of a large (some megabytes) file, what is the best practice to read them into the DataSet via the ReadXML() method?

Thanks, sorry for my newbie-hood

Dev

Nov 16 '05 #2
Dev
Hi,

If I use DataSet.ReadXML() specifyng a XmlReader as parameter, when I cycle
through the rows of the table in dataset is guaranteed that the XML is not
all in memory?

Thanks

Dev
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> ha
scritto nel messaggio news:uA*************@TK2MSFTNGP10.phx.gbl...
Dev,

There really isn't more than one way to do this. You are going to get
the best performance by using the ReadXml method, which uses streams and/or readers to read the data. That's the best you could do.

Unless you need to keep all of this in memory, you might want to look at processing the stream using an XmlReader. This would avoid all that
overhead of keeping it in memory.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Dev" <no******@sorry.com> wrote in message
news:eh**************@TK2MSFTNGP10.phx.gbl...
Good Morning to all,

I have a bunch of XML files that need to be readed inside the same DataSet (each XML represent a single table).

In the event of a large (some megabytes) file, what is the best practice

to
read them into the DataSet via the ReadXML() method?

Thanks, sorry for my newbie-hood

Dev


Nov 16 '05 #3
Dev,

Well, it guarantees that the XmlDocument isn't loaded into memory.
However, you are loading into the dataset, and eventually, the memory taken
up by that will be related to the memory of the data set (not completely, as
the dataset has a different internal structure than the DOM, but I would
think there is some relation).
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Dev" <no******@sorry.com> wrote in message
news:eg**************@tk2msftngp13.phx.gbl...
Hi,

If I use DataSet.ReadXML() specifyng a XmlReader as parameter, when I cycle through the rows of the table in dataset is guaranteed that the XML is not
all in memory?

Thanks

Dev
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> ha
scritto nel messaggio news:uA*************@TK2MSFTNGP10.phx.gbl...
Dev,

There really isn't more than one way to do this. You are going to get
the best performance by using the ReadXml method, which uses streams and/or
readers to read the data. That's the best you could do.

Unless you need to keep all of this in memory, you might want to look at
processing the stream using an XmlReader. This would avoid all that
overhead of keeping it in memory.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Dev" <no******@sorry.com> wrote in message
news:eh**************@TK2MSFTNGP10.phx.gbl...
Good Morning to all,

I have a bunch of XML files that need to be readed inside the same

DataSet (each XML represent a single table).

In the event of a large (some megabytes) file, what is the best

practice to
read them into the DataSet via the ReadXML() method?

Thanks, sorry for my newbie-hood

Dev



Nov 16 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: murphy | last post by:
I'm programming a site that displays info from AWS Commerce Service 4.0. At each change of the asp.net application the first load of a page that uses the web service takes 30 seconds. Subsequent...
0
by: james | last post by:
I have created a web service that returns a very large dataset. The performance of the web service is fine. The web service generates the dataset in about 3 seconds. However when I call the...
2
by: Irfan Akram | last post by:
Hi Guys, I am in search of some innovative ideas in improving the interface of Online Marking System. At the moment it has some good functionality, but lacks a professional interface. Is...
5
by: WebBuilder451 | last post by:
is there ant place where i can learn the basics of reading an rss feed and enumerating through the values? just want to start at the bottom, no frills. thanks -- thanks (as always) some day...
1
by: hzgt9b | last post by:
(FYI, using VB .NET 2003) Can someone help me with this... I'm trying to read in an XML file... it appears to work in that the DataSet ReadXML method dose not fail and then I am able to access the...
4
by: Amit Maheshwari | last post by:
I need to read text file having data either comma seperated or tab seperated or any custom seperator and convert into a DataSet in C# . I tried Microsoft Text Driver and Microsoft.Jet.OLEDB.4.0...
3
by: Brad | last post by:
I'm having a problem reading data from an Excel file into a dataset. Can anybody give me an idea of what's happening? I've included the problematic source and the error message to the end of this...
0
by: David | last post by:
Hi, using C# 1.1 I am writing a winform app that collects a dataset from a webservice. At the same time I collect the data, I write the dataset out to the local disk using DataSet.WriteXml,...
2
by: pkenderdine | last post by:
Can someone please advise the best approach for reading in many 5000+ xml files from disk into a data set. Here is the code so far. On my computer (may not be best spec) is takes about 3 minutes to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.