Using a memory-resident XmlSchema with a DataSet?

M

MyndPhlyp

I am attempting to write a DLL to maintain an XML file. It creates its own
XSD as an XmlSchema (or even a compiled member of an XmlSchemaSet, if
necessary).

I don't want to write an XSD to disk. The XML file, on the other hand, will
be disk resident.

System.Data.DataSet wants to read its schema in from an XmlReader, Stream,
TextReader, or file name string.

How does one get a System.Data.DataSet object to utilize a
System.Xml.Schema.XmlSchema object?
 
D

David Browne

MyndPhlyp said:
I am attempting to write a DLL to maintain an XML file. It creates its own
XSD as an XmlSchema (or even a compiled member of an XmlSchemaSet, if
necessary).

I don't want to write an XSD to disk. The XML file, on the other hand,
will
be disk resident.

System.Data.DataSet wants to read its schema in from an XmlReader, Stream,
TextReader, or file name string.

How does one get a System.Data.DataSet object to utilize a
System.Xml.Schema.XmlSchema object?

Use an XmlNodeReader, MemoryStream or StringReader to read from in-memory
stuff.

David
 
M

MyndPhlyp

David Browne said:
Use an XmlNodeReader, MemoryStream or StringReader to read from in-memory
stuff.

Cool. Thanks. I also (just) discovered XmlDataDocument has Schemas and
DataSet properties (the latter of which has a ReadXml method) and was about
to retract the plea for assistance. (Amazing what one can find if one spends
enough time RTFM!) All this time I've been bogged down on XmlDocument,
StreamReader/Writer and other such things.
 

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