Home > Articles > Programming > .NET and Windows Programming

Essential ADO.NET: XML and Data Access Integration

  • PrintPrint
  • Share ThisShare This
  • DiscussDiscuss

This chapter is from the book

Learn how ADO.NET not only supports relational data through the data provider, DataSet, and Adapter architecture, but also adds support for all types of nonrelational data through its integration with XML.

The DataSet class interoperates with XML schema and data. The XmlDataDocument combines XmlDocument and DataSet functionality.

7.1 XML and Traditional Data Access

The preceding chapters have talked about the data access stack mostly as it relates to traditional data access and relational data. Each time, I've mentioned nonrelational data (homogeneous and heterogeneous hierarchies and semistructured data) almost as an afterthought, or to illustrate that it would be a stretch to support it by using the classes in System.Data. But a wide variety of data can be represented in a nonrelational way. Here are a few examples.

  • LDAP readable directories, such as Active Directory, contain multivalued attributes. This violates relational theory's first normal form.

  • Each item in the NT file system is either a directory or a file. This is an example of a heterogeneous hierarchy. A related case is the reading of data from an Exchange store. Not only are contacts in the Contacts folder structured differently from mail messages in the Inbox, but also each mail message can contain 0–N attachments. The attachments can also vary in data format. Exchange—or other IMAP (Internet Mail Access Protocol) mail systems—can also expose hierarchical folders. All these data structures are analogous to the multiset in IDMS.

  • Screen scraping from HTML or XML pages consists of reading through a combination of text and tags and extracting only the data you need—for example, the number in the third column of the fourth row of an HTML table and the contents of the third <h3> tag. This is an example of semistructured data.

There are ways to approximate each different data type—with the possible exception of semistructured data—by using a variation of a relational concept. Sometimes, however, you need to present the data in an alternative, nonrelational format. For example, suppose you're managing an electronic student registration form that contains data that affects the value of 15 different normalized relational tables. In addition, the form may contain information, such as a request for low-fat, vegetarian meals, that has no correlation in the relational schema. You may want to store the information in the request into multiple tables and reproduce the original request on demand. This might require that you retain additional information or even the entire request in its original form. It might also be nice if the information could be transmitted in a platform-independent, universally recognized format. Enter XML.

  • Share ThisShare This
  • Save To Your Account
Essential ADO.NET

This chapter is from the book

Essential ADO.NET

Learn MoreAdd To Cart

Discussions

comments powered by Disqus

Related Resources

#TuesdayTrivia: Spotlight on WP7 (Win a copy of Sams Teach Yourself Windows Phone 7 Application Development)
By on May 2, 2012Comments
These days, what CAN'T a smartphone do? Microsoft is putting their own spin on things to help you experience "life in motion" when using your device. Instead of containing static application icons, the re-imagined Start screen features live Tiles showing real-time content updates.

March Trivia #1: Let there be light! (Win Microsoft Visual Studio LightSwitch Unleashed)
By on March 13, 2012Comments
Want a simplified self-service tool to help you build business applications for the desktop and beyond? Microsoft programmers… meet Visual Studio LightSwitch.

February Trivia #2: There's an App for That (Win Sams Teach Yourself iOS 5 Application Development in 24 Hours)
By on February 28, 2012Comments
In less than a decade, the iOS platform has changed the way we think about mobile communication.

See All Related Blogs