msdata Namespace

The msdata namespace extends a XSD document so that it can represent an ADO.NET DataSet. The msdata namespace is also used in XML documents: namely in the DiffGram representation of a DataSet (along with the diffgr namespace). Here’s an example of how the msdata namespace is imported in an XSD file:

<xs:schema id="DataSetName" xmlns="" 


    xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" >

One place where you’ll see the msdata namespace is in the element tag containing the XSD structure. Here, an IsDataSet attribute indicates that the schema is used to represent an ADO.NET DataSet:

<xs:element name="DataSetName" msdata:IsDataSet="true" >

The element tag also supports optional CaseSensitive and Local attributes:

<xs:element name="DataSetName"

    msdata:CaseSensitive="true" msdata:Locale="en">

More importantly, the msdata namespace represents various DataColumn properties that don’t have direct XSD mappings. Table B-4 lists these.

Table B-4. msdata column attributes



AutoIncrement, AutoIncrementSeed, AutoIncrementStep

Sets the auto-incrementing options for unique identity fields. These attributes map to corresponding DataColumn properties.


Specifies the display caption for the column. Maps to DataColumn.Caption.


Sets the expression used to filter rows, calculate the values in a column, or create an aggregate column. Maps to DataColumn.Expression.


Indicates (true or false ...

Get ADO.NET in a Nutshell now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.