O'Reilly logo

Microsoft® .NET Compact Framework Kick Start by Ronnie Yates, Erik Rubin

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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() ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required