Events for ReadXML Method

J

Jeff B.

Does anyone know if there is any way to trap some type of event that gets
fired when the ReadXML method is called? What I am doing is reading in an
XML file (that was exported from an ADO.NET DataSet from another process)
that has several thousand records in it. This process takes anywhere
between 5 and 30 seconds (based upon the current XML file sizes I'm using).
What I would like to do is be able to display the progress in the UI (e.g.
via a progress bar control) as the rows are read in from the XML file. I
realize there are several events on the DataSet.Table[...] object, however,
the table does not yet exist so I can't tie to those events.

Any ideas?

--- Thanks, Jeff
 
K

Kevin Yu [MSFT]

Hi Jeff,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that you need to know if there is any event
for we to catch during reading Xml to a DataSet, so that we can decide the
progress of reading process. If there is any misunderstanding, please feel
free to let me know.

I'm afraid, currently, we don't have such events for us to handler. The
only way is to make a subclass of DataSet and override the ReadXml mehod,
firing your own events. But I think it to complex, and not suitable to your
senario.

HTH.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 
J

Jeff B.

I'm afraid, currently, we don't have such events for us to handler. The
only way is to make a subclass of DataSet and override the ReadXml mehod,
firing your own events. But I think it to complex, and not suitable to
your
senario.

Kevin,

Thanks for the reply. That was pretty much my suspicion but just wanted to
confirm. I thought about creating a helper method that uses a XmlTextReader
class to populate a DataSet from an XML file but I figured if the DataSet's
inherent ReadXML method took long enough that I need to display a progress
meter then any method I come up with will be even slower. So, I'll just not
worry about it for now :)

--- Thanks, Jeff
 
K

Kevin Yu [MSFT]

You're welcome, Jeff.

Thanks for sharing your experience with all the people here. If you have
any questions, please feel free to post them in the community.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top