WriteXML/ReadXML

J

Jamie Dulaney

I have encountered a problem and was wondering if someone could enlighten me
on what I am doing wrong...

I have a typed ADO Dataset (call it DatasetA). I do the following:

DatasetA.WriteXML(myStream, XmlWriteMode.DiffGram);
.... (I write the stream to a file here)...

Later..

.... (I read from file to a stream here)....
DatasetA.ReadXML(myStream, XMLReadMode.DiffGram)

I get an exception on the ReadXML statement (Root Node Not Found)? I don't
really understand what I am doing wrong. My goal is to save the
original/current images of the data within the dataset and on a subsequent
postback from an ASP.NET web form to pull in the diffgram.... I know I
could serialize (using the binary formatter or other). I have used the
binary formatter... The performance on that was dreadful... Really just
stumbled on this problem while I was trying to find a faster method to store
and restore a typed ADO dataset to disk.... Any help would be
appreciated...
 
K

Kevin Sun [MS]

Create a new instance of the myStream before calling ReadXML method, does
the same problem occur?

We have an article that demonstrate how to use readxml method to read data
into a dataset as below:

309702.KB.EN-US HOW TO: Read XML Data into a DataSet by Using Visual Basic
.NET
http://support.microsoft.com/default.aspx?scid=KB;EN-US;309702

Sincerely,

Kevin
Microsoft Support

This posting is provided "AS IS" with no warranties, and confers no rights.
Get Secure! - www.microsoft.com/security

--------------------
| From: "Jamie Dulaney" <[email protected]>
| Subject: WriteXML/ReadXML
| Date: Thu, 16 Oct 2003 09:16:45 -0500
| Lines: 24
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
| Message-ID: <[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.adonet
| NNTP-Posting-Host: crtntx1-ar2-091-210.crtntx1.dsl-verizon.net 4.33.91.210
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.adonet:63770
| X-Tomcat-NG: microsoft.public.dotnet.framework.adonet
|
| I have encountered a problem and was wondering if someone could enlighten
me
| on what I am doing wrong...
|
| I have a typed ADO Dataset (call it DatasetA). I do the following:
|
| DatasetA.WriteXML(myStream, XmlWriteMode.DiffGram);
| ... (I write the stream to a file here)...
|
| Later..
|
| ... (I read from file to a stream here)....
| DatasetA.ReadXML(myStream, XMLReadMode.DiffGram)
|
| I get an exception on the ReadXML statement (Root Node Not Found)? I
don't
| really understand what I am doing wrong. My goal is to save the
| original/current images of the data within the dataset and on a subsequent
| postback from an ASP.NET web form to pull in the diffgram.... I know I
| could serialize (using the binary formatter or other). I have used the
| binary formatter... The performance on that was dreadful... Really just
| stumbled on this problem while I was trying to find a faster method to
store
| and restore a typed ADO dataset to disk.... Any help would be
| appreciated...
|
|
|
 

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