O'Reilly logo

ADO.NET in a Nutshell by Bill Hamilton, Matthew MacDonald

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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:xs="http://www.w3.org/2001/XMLSchema"

    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

Attribute

Description

AutoIncrement, AutoIncrementSeed, AutoIncrementStep

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

Caption

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

Expression

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

ReadOnly

Indicates (true or false ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required