Reading a DataSet from XML, Ignoring Schema Information

If you have a DataSet with a schema already loaded, you might want to read XML data without reading the schema associated with the XML. To read XML into a DataSet and ignore the schema information in the XML, call DataSet.ReadXml(XmlReader, XmlReadMode), and pass XmlReadMode.IgnoreSchema as an argument. For example:

 C# l_XmlTextReader = new System.Xml.XmlTextReader(new System.IO.StreamReader("\\MIGHT_HAVE_SCHEMA.xml.xml")); l_DataSet.ReadXml(l_XmlTextReader, XmlReadMode.IgnoreSchema); l_XmlTextReader.Close(); VB l_XmlTextReader = new System.Xml.XmlTextReader(new System.IO.StreamReader("\MIGHT_HAVE_SCHEMA.xml.xml")) l_DataSet.ReadXml(l_XmlTextReader, XmlReadMode.IgnoreSchema) l_XmlTextReader.Close() ...

Get Microsoft® .NET Compact Framework Kick Start now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.