PC Review


Reply
Thread Tools Rate Thread

Dataset.ReadXml: M/c hangs when trying to read 37mb xml string.

 
 
=?Utf-8?B?U2F2dnk=?=
Guest
Posts: n/a
 
      11th Sep 2006
Hi All,
I am trying to read a 37 mb xml from a url into a stream and then store it
in a string variable "_xml". When I try to pass this string as a StringReader
object to the ReadXml method, my m/c hangs and I have to kill the process.
Is there any upper limit on the size of data which can be passed to the
Dataset's ReadXml method? If yes, can anyone point me to the documentation or
help me resolve this issue.

Here is the piece of code:

WebClient wc = new WebClient();
Stream stream = wc.OpenRead(_url); //Url returns 37mb xml data.
StreamReader sReader = new StreamReader(stream);
string _xml = sReader.ReadToEnd();
_ds = new DataSet();

_ds.ReadXml(new StringReader(_xml), XmlReadMode.InferSchema);

Thanks in advance.
Savvy
 
Reply With Quote
 
 
 
 
Patrice
Guest
Posts: n/a
 
      11th Sep 2006
For now I woud try to get the file locally to see if the problem is in
getting the file over http or loading it in the DS. Also you'll be then able
to modify this file to see how it performs when loaded in the DataSet...

You could also create a dummy table wiht numerous records and save/restore
the DS to see if you can overcome 37 Mb. How much dio you wait ? Could it be
just slow ?

Good luck.

--
Patrice

"Savvy" <(E-Mail Removed)> a écrit dans le message de news:
4002A4F1-D01F-4EB7-8C70-(E-Mail Removed)...
> Hi All,
> I am trying to read a 37 mb xml from a url into a stream and then store it
> in a string variable "_xml". When I try to pass this string as a
> StringReader
> object to the ReadXml method, my m/c hangs and I have to kill the process.
> Is there any upper limit on the size of data which can be passed to the
> Dataset's ReadXml method? If yes, can anyone point me to the documentation
> or
> help me resolve this issue.
>
> Here is the piece of code:
>
> WebClient wc = new WebClient();
> Stream stream = wc.OpenRead(_url); //Url returns 37mb xml data.
> StreamReader sReader = new StreamReader(stream);
> string _xml = sReader.ReadToEnd();
> _ds = new DataSet();
>
> _ds.ReadXml(new StringReader(_xml), XmlReadMode.InferSchema);
>
> Thanks in advance.
> Savvy



 
Reply With Quote
 
=?Utf-8?B?U2F2dnk=?=
Guest
Posts: n/a
 
      11th Sep 2006
Hi,
The url in this case is a xml file present on my own m/c in a virtual
directory. The file gets loaded over http pretty fast and gets stuck on this
line of code:
_ds.ReadXml(new StringReader(_xml), XmlReadMode.InferSchema);

I waited for > 10 mins. for the xml string to load in the dataset but the
debugger doesn't proceed to the next line of code and the m/c hangs.

Thanks,

"Patrice" wrote:

> For now I woud try to get the file locally to see if the problem is in
> getting the file over http or loading it in the DS. Also you'll be then able
> to modify this file to see how it performs when loaded in the DataSet...
>
> You could also create a dummy table wiht numerous records and save/restore
> the DS to see if you can overcome 37 Mb. How much dio you wait ? Could it be
> just slow ?
>
> Good luck.
>
> --
> Patrice
>
> "Savvy" <(E-Mail Removed)> a écrit dans le message de news:
> 4002A4F1-D01F-4EB7-8C70-(E-Mail Removed)...
> > Hi All,
> > I am trying to read a 37 mb xml from a url into a stream and then store it
> > in a string variable "_xml". When I try to pass this string as a
> > StringReader
> > object to the ReadXml method, my m/c hangs and I have to kill the process.
> > Is there any upper limit on the size of data which can be passed to the
> > Dataset's ReadXml method? If yes, can anyone point me to the documentation
> > or
> > help me resolve this issue.
> >
> > Here is the piece of code:
> >
> > WebClient wc = new WebClient();
> > Stream stream = wc.OpenRead(_url); //Url returns 37mb xml data.
> > StreamReader sReader = new StreamReader(stream);
> > string _xml = sReader.ReadToEnd();
> > _ds = new DataSet();
> >
> > _ds.ReadXml(new StringReader(_xml), XmlReadMode.InferSchema);
> >
> > Thanks in advance.
> > Savvy

>
>
>

 
Reply With Quote
 
Patrice
Guest
Posts: n/a
 
      11th Sep 2006
What if you load a smaller version of this file ? Does it work ?

--
Patrice

"Savvy" <(E-Mail Removed)> a écrit dans le message de news:
843FEB6D-9C94-463C-BBB8-(E-Mail Removed)...
> Hi,
> The url in this case is a xml file present on my own m/c in a virtual
> directory. The file gets loaded over http pretty fast and gets stuck on
> this
> line of code:
> _ds.ReadXml(new StringReader(_xml), XmlReadMode.InferSchema);
>
> I waited for > 10 mins. for the xml string to load in the dataset but the
> debugger doesn't proceed to the next line of code and the m/c hangs.
>
> Thanks,
>
> "Patrice" wrote:
>
>> For now I woud try to get the file locally to see if the problem is in
>> getting the file over http or loading it in the DS. Also you'll be then
>> able
>> to modify this file to see how it performs when loaded in the DataSet...
>>
>> You could also create a dummy table wiht numerous records and
>> save/restore
>> the DS to see if you can overcome 37 Mb. How much dio you wait ? Could it
>> be
>> just slow ?
>>
>> Good luck.
>>
>> --
>> Patrice
>>
>> "Savvy" <(E-Mail Removed)> a écrit dans le message de
>> news:
>> 4002A4F1-D01F-4EB7-8C70-(E-Mail Removed)...
>> > Hi All,
>> > I am trying to read a 37 mb xml from a url into a stream and then store
>> > it
>> > in a string variable "_xml". When I try to pass this string as a
>> > StringReader
>> > object to the ReadXml method, my m/c hangs and I have to kill the
>> > process.
>> > Is there any upper limit on the size of data which can be passed to the
>> > Dataset's ReadXml method? If yes, can anyone point me to the
>> > documentation
>> > or
>> > help me resolve this issue.
>> >
>> > Here is the piece of code:
>> >
>> > WebClient wc = new WebClient();
>> > Stream stream = wc.OpenRead(_url); //Url returns 37mb xml data.
>> > StreamReader sReader = new StreamReader(stream);
>> > string _xml = sReader.ReadToEnd();
>> > _ds = new DataSet();
>> >
>> > _ds.ReadXml(new StringReader(_xml), XmlReadMode.InferSchema);
>> >
>> > Thanks in advance.
>> > Savvy

>>
>>
>>



 
Reply With Quote
 
=?Utf-8?B?U2F2dnk=?=
Guest
Posts: n/a
 
      11th Sep 2006
It works with upto 2 MB Xml file (smaller version of the 37mb xml file) and
takes around 2.5 minutes to load it in dataset.

Any other inputs??

--Savvy

"Patrice" wrote:

> What if you load a smaller version of this file ? Does it work ?
>
> --
> Patrice
>
> "Savvy" <(E-Mail Removed)> a écrit dans le message de news:
> 843FEB6D-9C94-463C-BBB8-(E-Mail Removed)...
> > Hi,
> > The url in this case is a xml file present on my own m/c in a virtual
> > directory. The file gets loaded over http pretty fast and gets stuck on
> > this
> > line of code:
> > _ds.ReadXml(new StringReader(_xml), XmlReadMode.InferSchema);
> >
> > I waited for > 10 mins. for the xml string to load in the dataset but the
> > debugger doesn't proceed to the next line of code and the m/c hangs.
> >
> > Thanks,
> >
> > "Patrice" wrote:
> >
> >> For now I woud try to get the file locally to see if the problem is in
> >> getting the file over http or loading it in the DS. Also you'll be then
> >> able
> >> to modify this file to see how it performs when loaded in the DataSet...
> >>
> >> You could also create a dummy table wiht numerous records and
> >> save/restore
> >> the DS to see if you can overcome 37 Mb. How much dio you wait ? Could it
> >> be
> >> just slow ?
> >>
> >> Good luck.
> >>
> >> --
> >> Patrice
> >>
> >> "Savvy" <(E-Mail Removed)> a écrit dans le message de
> >> news:
> >> 4002A4F1-D01F-4EB7-8C70-(E-Mail Removed)...
> >> > Hi All,
> >> > I am trying to read a 37 mb xml from a url into a stream and then store
> >> > it
> >> > in a string variable "_xml". When I try to pass this string as a
> >> > StringReader
> >> > object to the ReadXml method, my m/c hangs and I have to kill the
> >> > process.
> >> > Is there any upper limit on the size of data which can be passed to the
> >> > Dataset's ReadXml method? If yes, can anyone point me to the
> >> > documentation
> >> > or
> >> > help me resolve this issue.
> >> >
> >> > Here is the piece of code:
> >> >
> >> > WebClient wc = new WebClient();
> >> > Stream stream = wc.OpenRead(_url); //Url returns 37mb xml data.
> >> > StreamReader sReader = new StreamReader(stream);
> >> > string _xml = sReader.ReadToEnd();
> >> > _ds = new DataSet();
> >> >
> >> > _ds.ReadXml(new StringReader(_xml), XmlReadMode.InferSchema);
> >> >
> >> > Thanks in advance.
> >> > Savvy
> >>
> >>
> >>

>
>
>

 
Reply With Quote
 
Patrice
Guest
Posts: n/a
 
      11th Sep 2006
If the time is linear it should take about 45 minutes then ? I would wait
more than 10 minutes, launching this at luch time or in the evening. Also I
didn't noticed at first but this method will likely have a huge memory
comsumption.

For now I would say it is just really slow and you have to wait more...

Another option would be likely to get the file on disk and read from there.

I tried to create a dummy datatable with 10 string fields with 40 characters
each. It is around 30 Mb and it takes only 7 s to load....

Good luck.

--
Patrice

"Savvy" <(E-Mail Removed)> a écrit dans le message de news:
6CC5047A-9EAB-4A84-9E89-(E-Mail Removed)...
> It works with upto 2 MB Xml file (smaller version of the 37mb xml file)
> and
> takes around 2.5 minutes to load it in dataset.
>
> Any other inputs??
>
> --Savvy
>
> "Patrice" wrote:
>
>> What if you load a smaller version of this file ? Does it work ?
>>
>> --
>> Patrice
>>
>> "Savvy" <(E-Mail Removed)> a écrit dans le message de
>> news:
>> 843FEB6D-9C94-463C-BBB8-(E-Mail Removed)...
>> > Hi,
>> > The url in this case is a xml file present on my own m/c in a virtual
>> > directory. The file gets loaded over http pretty fast and gets stuck on
>> > this
>> > line of code:
>> > _ds.ReadXml(new StringReader(_xml), XmlReadMode.InferSchema);
>> >
>> > I waited for > 10 mins. for the xml string to load in the dataset but
>> > the
>> > debugger doesn't proceed to the next line of code and the m/c hangs.
>> >
>> > Thanks,
>> >
>> > "Patrice" wrote:
>> >
>> >> For now I woud try to get the file locally to see if the problem is in
>> >> getting the file over http or loading it in the DS. Also you'll be
>> >> then
>> >> able
>> >> to modify this file to see how it performs when loaded in the
>> >> DataSet...
>> >>
>> >> You could also create a dummy table wiht numerous records and
>> >> save/restore
>> >> the DS to see if you can overcome 37 Mb. How much dio you wait ? Could
>> >> it
>> >> be
>> >> just slow ?
>> >>
>> >> Good luck.
>> >>
>> >> --
>> >> Patrice
>> >>
>> >> "Savvy" <(E-Mail Removed)> a écrit dans le message de
>> >> news:
>> >> 4002A4F1-D01F-4EB7-8C70-(E-Mail Removed)...
>> >> > Hi All,
>> >> > I am trying to read a 37 mb xml from a url into a stream and then
>> >> > store
>> >> > it
>> >> > in a string variable "_xml". When I try to pass this string as a
>> >> > StringReader
>> >> > object to the ReadXml method, my m/c hangs and I have to kill the
>> >> > process.
>> >> > Is there any upper limit on the size of data which can be passed to
>> >> > the
>> >> > Dataset's ReadXml method? If yes, can anyone point me to the
>> >> > documentation
>> >> > or
>> >> > help me resolve this issue.
>> >> >
>> >> > Here is the piece of code:
>> >> >
>> >> > WebClient wc = new WebClient();
>> >> > Stream stream = wc.OpenRead(_url); //Url returns 37mb xml data.
>> >> > StreamReader sReader = new StreamReader(stream);
>> >> > string _xml = sReader.ReadToEnd();
>> >> > _ds = new DataSet();
>> >> >
>> >> > _ds.ReadXml(new StringReader(_xml), XmlReadMode.InferSchema);
>> >> >
>> >> > Thanks in advance.
>> >> > Savvy
>> >>
>> >>
>> >>

>>
>>
>>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
null value in xml translates to empty string in dataset after ReadXML BillE Microsoft ADO .NET 1 25th Apr 2008 10:48 PM
ReadXml() method: standard DataSet vs. typed DataSet MikeOtown Microsoft ADO .NET 0 6th Dec 2007 05:15 PM
DataSet.ReadXml and "Input string was not in a correct format." =?Utf-8?B?QW1pciBUb2hpZGk=?= Microsoft ADO .NET 0 12th Jul 2007 05:22 PM
DataSet.XmlReader hangs when & is in string within XML file =?Utf-8?B?U3RldmVU?= Microsoft C# .NET 4 21st Aug 2006 02:09 AM
Re: does DataSet.ReadXml() clear current table information on DataSet CrunkByte Microsoft Dot NET Framework 0 21st May 2005 03:11 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:01 AM.