473,409 Members | 2,056 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,409 software developers and data experts.

Loading dataset from XML

I had come across a code block from Loading a DataSet from XML (.NET
Framework Developer's Guide)
----------------------------------------
NOte If you call ReadXML to load a very large file, you may encounter slow
performance. To ensure best performance for ReadXml, on a large file, call
the DataTable.BeginLoadData method for each table in the DataSet, then call
ReadXml. Finally, call DataTable.EndLoadData for each table in the DataSet
as shown in the following example.

DataSet ds = new DataSet();

// How do I know how many table since I haven't load the XML data yet.
foreach(DataTable t in ds.Tables)
t.BeginLoadData();
ds.ReadXml("dotNET.xml");
// Here okay I may know how many table since I loaded the XML data.
foreach(DataTable t in ds.Tables)
t.EndLoadData();

How can this code improve reading large XML performance?
Cheers,
Kids
Nov 16 '05 #1
1 3121

"kids_pro" <ki******@yahoo.com> schrieb im Newsbeitrag
news:%2****************@TK2MSFTNGP10.phx.gbl...
I had come across a code block from Loading a DataSet from XML (.NET
Framework Developer's Guide)
----------------------------------------
NOte If you call ReadXML to load a very large file, you may encounter slow
performance. To ensure best performance for ReadXml, on a large file, call
the DataTable.BeginLoadData method for each table in the DataSet, then call ReadXml. Finally, call DataTable.EndLoadData for each table in the DataSet
as shown in the following example.

DataSet ds = new DataSet();

// How do I know how many table since I haven't load the XML data yet.
ds.ReadXml("dotNET.xml",System.Data.XmlReadMode.Re adSchema);

foreach(DataTable t in ds.Tables)
t.BeginLoadData();
ds.ReadXml("dotNET.xml");
// Here okay I may know how many table since I loaded the XML data.
foreach(DataTable t in ds.Tables)
t.EndLoadData();

How can this code improve reading large XML performance?
Cheers,
Kids

Nov 16 '05 #2

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

Similar topics

2
by: Patrick J. Schouten | last post by:
I am trying to transfor an XML document prior to loading into a Dataset. My problem stems from the known bug in Visual Studio that prevents loading a well formed XML because of duplicate child...
3
by: Mauricio Correa L. | last post by:
Hello, i have a string with a XML inside, but when a try lo load a dataset with the next code. Dim all As String = Webservice.getName(TextName.Text, TextNo2.Text).ToString 'this webmethod return...
0
by: J-T | last post by:
I have a CSV file which contains comma seperated data that I need to validate against our database.I was thinking about loading that CSV file into a Typed-Dataset which has our database schema in...
4
by: Fred Nelson | last post by:
I have an applicatioin that I'm writing that uses a "case" file that contains over 350 columns and more may be added in the future. I would like to create a dataset with all the column names and...
4
by: mrmagoo | last post by:
I'm building a vb.net Forms project that is getting data from a SQL Server database. One of the main goals of the project is to be really responsive to events, such as textbox change events. I...
7
by: koonda | last post by:
Hi guys, I am trying to create a web interface in C# using ASP.NET. The database being used is SQL Server. I have some problems loading the tables in the datalist controls. When I run the program...
0
by: Chris | last post by:
Hello, I have a problem with re-loading datasets. As a simple example, if I have an SQL table of addresses comprising active and inactive addresss, I wish to load either sub-set by clicking on...
6
by: cmorgan76 | last post by:
This is a 2 part question: Part 1: I am accesing a web service that returns an xml string of user information. I am attempting to load the XML into an XMLDocument, save the document, load it...
2
by: TexasAggie96 | last post by:
I am working on a project where I get a XML datastream back from an application API which may contain a particular value that may be emty. An example of this can be seen below <?xml...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.