Thanks....it works like a charm.
"Alex Feinman [MVP]" <public_news@alexfeinman.com> wrote in message
news:ulVoTu2BFHA.3820@TK2MSFTNGP11.phx.gbl...
> When facing a similar problem I found that one way to provide visual
> feedback was to use a little trick. We know that the xml parser loads
> document sequentially, so that all we need is to find out which position
of
> the document is being requested right now. We do this by deriving our own
> class from a stream and feeding it to the XmlDocument.Load. Our class
simply
> forwards every request to the base class, but makes sure to raise an event
> on every Read operation, passing to the handler the current stream
position.
>
> A sample is available at
>
http://www.alexfeinman.com/download.asp?doc=LoadXmlWithProgress.zip >
> As pointed out in the source code comments, if you need to load xml from a
> string in memory which did not originate as a file or network stream (very
> unlikely), you can do a similar thing with the TextReader class
>
> --
> Alex Feinman
> ---
> Visit
http://www.opennetcf.org > "RC" <rc@gmail.com> wrote in message
> news:e0HltF2BFHA.1392@tk2msftngp13.phx.gbl...
> >I now want to load a large XML file.
> > How to show the updating progress on the progress bar?
> > The difficulty is how can I get the amount of the file being loaded.
> >
> > XmlDocument doc = new XmlDocument();
> > doc.load(data.xml); //<---it takes long time to load
> >
> > Any sample code or solution provided?
> >
> >
>