Using a memory-resident XmlSchema with a DataSet?

  • Thread starter Thread starter MyndPhlyp
  • Start date Start date
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?
 
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
 
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.
 
Back
Top