This article, by Graeme Malcolm, will show how to retrieve data using XML schemas and SQLXML functionality. Beginning with a discussion of schemas and the XSD syntax, default and explicit mappings will be described. Graeme will then introduce the relationship annotation and its use in retrieving data from multiple, related tables. The key-fields annotation is discussed next, followed by the use of the is-constant annotation.
After the main schema annotations have been discussed, Graeme will move on to show how schemas can be used to retrieve data from .NET applications using the SQLXML managed classes. He will also describe the use of an XPath to indicate the "start point" of a query, as well as the selection criteria and the ways to use a SqlXMLCommand class to retrieve XML data from a mapping schema. Finally, he will show how to retrieve and update a DataSet through a mapping schema and the SqlXmlAdapter class.