Chapter 9. Working with XML Data
9.0. Introduction
ADO.NET and XML classes are tightly integrated in the .NET Framework. The DataSet can be filled with data or a schema from an XML stream or document. The DataSet can persist or serialize its data or schema to an XML stream or document. You can simultaneously work with the same data in a DataSet and with its XML representation. This chapter focuses on XML support in ADO.NET and in SQL Server.
The XML support in .NET is provided by classes in six namespaces:
System.XmlContains classes that provide standards-based support for processing XML.
System.Xml.LinqContains classes that provide support for LINQ to XML.
System.Xml.SchemaContains classes that provide standards-based support for XML Schema Definition (XSD) language schemas.
System.Xml.SerializationContains classes that serialize objects into XML documents or streams.
System.Xml.XPathContains classes that parse and evaluate XPath.
System.Xml.XslContains classes that support Extensible Stylesheet Language (XSL) transformations.
.NET Framework classes support saving and loading both XML data and schema from and to ADO.NET disconnected classes. Recipe 9.1 shows how to load XML data into a DataSet or DataTable and how to save data in a DataSet or DataTable to an XML file. Recipe 9.2 shows how to load an XML schema into a DataSet and how to save the schema of a DataSet as an XML schema file. Recipe 9.3 shows how to customize the format of XML data saved from a DataSet.
The DiffGram is an XML ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access