XML and ADO.NET
| CSharp-Online.NET:Articles |
| Database Articles |
|
XML and ADO.NET |
| © 2005 Sahil Malik |
| This article—XML and ADO.NET—is from Pro ADO.NET 2.0, by Sahil Malik. Copyright © 2005 Sahil Malik. All rights reserved. Reproduced by permission. This article has been edited especially for C# Online.NET. Read the book review! |
|
(Since C# Online.NET is primarily a C# Web site, the Visual Basic examples present in the original have been omitted here.)
XML and ADO.NET
Lingua franca: A common language used by speakers of different languages
It wouldn’t be a stretch of imagination to say that if English is the lingua franca of the world, XML is probably the lingua franca of the computer world. XML by the very nature of it allows you to create a structured and hierarchical representation of your data. Because it is text based, it can flow freely from one platform to another; and because parsers and standard schema exist on most platforms for its validation, it is the almost de facto choice for transferring data between different applications on different platforms.
Since ADO.NET is a data access architecture, and XML is a popular method to hold and move data, it is quite reasonable to expect that ADO.NET has significant interoperability with XML built in it. As a matter of fact, in the .NET Framework itself, there is the System.XML namespace that is entirely devoted to working with data in XML form.
In Chapter 6, you have already seen some interoperability within the DataSet object and XML. You saw how easy it is to convert both a DataSet and a DataTable to XML and vice versa. You also saw how XSD schemas, which are XML, dictate the structure and data validity of a strongly typed DataSet.
This chapter and the next present concepts specific to SQL Server. This chapter carries that discussion forward and introduces you to the ability of leveraging the XML features built in SQL Server. This chapter also looks into the new XML data type in SQL Server 2005 and how you can use that to build better architected applications.
Finally, this chapter looks at the SqlXml data provider that has been included as a part of the .NET Framework 2.0, but was also available in a previous version as a part of Microsoft Data Access Components (MDAC) and could be used in .NET 1.1 and before.
But first, let’s start with the basics and examine how you can leverage the XML features built in the Microsoft SQL Server database.
|


