RE: Read a dataset from a stream
From: Ilya Tumanov [MS] (ilyatum_at_online.microsoft.com)
Date: 12/21/04
- Next message: Nick Hoggard: "Re: Help ... Name '_xyx' is not declared"
- Previous message: Nille: "On/off"
- In reply to: Todd A: "Read a dataset from a stream"
- Next in thread: Todd A: "Re: Read a dataset from a stream"
- Reply: Todd A: "Re: Read a dataset from a stream"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 21 Dec 2004 22:10:46 GMT
You need to use DataSet.ReadXml(XmlReader reader) overload. Create a new
instance of XmlTextReader to pass to ReadXml() with the following overload:
XmlTextReader(Stream input).
Should you get an exception for valid XML, make sure data is decrypted
correctly.
Best regards,
Ilya
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
> From: "Todd A" <zeus@olympus.com>
> Subject: Read a dataset from a stream
> Date: Tue, 21 Dec 2004 15:51:13 -0600
> Lines: 31
> X-Priority: 3
> X-MSMail-Priority: Normal
> X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441
> Message-ID: <eJRrxc65EHA.4072@TK2MSFTNGP10.phx.gbl>
> Newsgroups: microsoft.public.dotnet.framework.compactframework
> NNTP-Posting-Host: samaha1.gofast.net 206.147.205.226
> Path:
cpmsftngxa10.phx.gbl!TK2MSFTFEED01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10
phx.gbl
> Xref: cpmsftngxa10.phx.gbl
microsoft.public.dotnet.framework.compactframework:67365
> X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework
>
> Does anyone have a method up their sleeve to read a DataSet from a Stream?
> I see that the DataSet.ReadXML(stream) is not supported in the .NET CF.
>
> The dataset I am trying to read is on the PPC file system, but it is
> encrypted.
> I retreive the file, decrypt it, and now have the "text" of the xml in a
> string/stream variable.
>
> I would now like to read this string/stream variable into a new dataset.
>
> I know I could rewrite the decrypted XML to the file system, and read it
> from there, but I am trying to avoid leaving any hint of decrypted data on
> the file system.
>
> I've tried using an XMLReader, but can't seem to locate the correct method
> and or sequence of events to get it into a dataset. I do get an error
that
> reads:
>
> "This is an unexpected token. The expected toekn is 'NAME. Line 1,
position
> 2."
>
> The XML in the stream/string includes it's schema. The XML consists of
> two(2) tables with one relationship between them. (parent key/foreign key)
>
> I can use either a string or a stream for this task.
>
> Thank you,
>
> Todd Acheson
>
>
>
- Next message: Nick Hoggard: "Re: Help ... Name '_xyx' is not declared"
- Previous message: Nille: "On/off"
- In reply to: Todd A: "Read a dataset from a stream"
- Next in thread: Todd A: "Re: Read a dataset from a stream"
- Reply: Todd A: "Re: Read a dataset from a stream"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|