XmlDataDocument Serialization

G

Guest

Hi Ng,

I have an XmlDataDocument which I want to serialize, so that I can store it
in my Sql server via ADO.NET. It should be possible to read it out again and
create a similar XmlDataDocument instance, so that I can work with it.
Unfortunatly, the XmlDataDocument isn't serializable from nature. But, the
DataSet is. My question no 1:

How do I create a DataSet out of the XmlDataDocument without going over a
temp file on the harddisk. Or do I have to go over a temp file?

My question no 2:

How do I create a byte stream of my DataSet, so that it can be stored in the
Sql Server as a BLOB?

My question no 3:
How do I get back my XmlDataDocument out of the serialized DataSet, out of
the Sql Server BLOB?

Or do I have the wrong approach and is there a much simplier and better way?

I would like to thank you very much in advance.

Regards,
Patrick
 
V

Val Mazur

Hi,

1. When you load DataSet schema using ReadXmlSchema method, you could
specify steam, not just a file. If this is a memory stream, then it will
work without creating any additional files.
2,3. check next KB about how to serialize and deserialize DataSet using
binary format stream. What you could do is to write this binary into BLOB
field and later on load stream back from the database.

http://support.microsoft.com/default.aspx?scid=kb;en-us;326504
 

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