RE: Read a dataset from a stream

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Ilya Tumanov [MS] (ilyatum_at_online.microsoft.com)
Date: 12/21/04


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
>
>
>



Relevant Pages

  • Read a dataset from a stream
    ... Does anyone have a method up their sleeve to read a DataSet from a Stream? ... I retreive the file, decrypt it, and now have the "text" of the xml in a ... I know I could rewrite the decrypted XML to the file system, ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: Data table text I/O package?
    ... regular and homogenuous data in mind. ... Given a data format much like in, ... I said XML is good for parsing of data if you cannot tell in advance that the data stream is totally free of errors. ... However, if some data item contains a separator due to an error, you loose the whole stream, or use the wrong data without noticing this, in the worst case. ...
    (comp.lang.ada)
  • RE: Unparsed Interchange
    ... but have you tried setting your stream position back ... from the received one (flat recieved -> xml out with some new parameters). ... // Get the original filename ... string filename = inmsg.Context.Read("ReceivedFileName", ...
    (microsoft.public.biztalk.general)
  • Error message when opening a recordset with a strem containing xml
    ... I have a problem when trying to open a recordset with a stream including xml ... System.String schemaText = null; ...
    (microsoft.public.data.ado)
  • Re: Processing Word documents
    ... where it can take an already opened stream. ... to Biztalk do that to convert to XML which BizTalk then reads, ... Second option is to develop a custom pipeline component that would ...
    (microsoft.public.biztalk.general)