All You Need To Know About ADO.NET: Part 2/2 - Examining the XSD
(Page 5 of 6 )
As we have seen, the DataSet generated is saved as an .xsd file. If we open the xsd file in a text editor, we see the following HTML like tags, Though we need not know the XML in depth, the marked portion can easily tell us the details about our table name, column names and Key:
<?xml version="1.0" encoding="utf-8" ?>
<xs:schema id="DsXML" targetNamespace="http://tempuri.org/DsXML.xsd" elementFormDefault="qualified" attributeFormDefault="qualified" xmlns="http://tempuri.org/DsXML.xsd" xmlns:mstns="http://tempuri.org/DsXML.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xs:element name="DsXML" msdata:IsDataSet="true">
<xs:complexType>
<xs:choice maxOccurs="unbounded">
<xs:element name="MyTable">
<xs:complexType>
<xs:sequence></xs:sequence>
<xs:attribute name="LastName" type="xs:string" />
<xs:attribute name="FirstName" type="xs:string" />
<xs:attribute name="MyID" type="xs:long" />
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
<xs:key name="DsXMLKey1" msdata:PrimaryKey="true">
<xs:selector xpath=".//mstns:MyTable" />
<xs:field xpath="@mstns:MyID" />
</xs:key>
</xs:element>
</xs:schema> Passing Datasets AS ADO.NET uses XML as its default format, passing the DataSet between two applications or two components becomes very easy. To transmit an ADO RecordSet, COM marshalling has to be used while ADO.NET uses an XML stream. In general, we can say that the following are the benefits of using XML as a native data format over COM marshalling.
XML as the Native Language COM marshalling supports only a limited set of data types whereas there's no such restriction in XML format.
AS XML does not require data type conversion, it gives a distinct performance advantage over ADO, which requires data type conversion.
Firewalls are created to let HTML text pass, but to stop any system level requests from accessing the server. As XML is a text based protocol, it is able to pass through firewalls.
Next: Conclusion >>
More ADO.NET Articles
More By Vaijayantee Sateesh Kamat