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

codegen Namespace

The codegen namespace gives you fine-grained control of a typed DataSet. By adding codegen attributes, you can configure the names that are used for methods, properties, relations, and constraints. When using the codegen namespace, it should be imported as shown:

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

    xmlns:xs="http://www.w3.org/2001/XMLSchema"

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

    xmlns:codegen="urn:schemas-microsoft-com:xml-msprop" >

Warning

codegen attributes configure the names used in strongly typed DataSet objects. They do not have any effect on the functionality of the generated DataSet class.

Table B-1 indicates where the various codegen attributes can be used and what they accomplish. Table B-2 briefly describes each attribute.

Table B-1. codegen attribute use

Typed DataSet object/method/event

Default name

codegen attribute

DataTable
TableNameDataTable
typedPlural
DataTable Methods
NewTableNameRow 

AddTableNameRow

DeleteTableNameRow
typedName
DataRowCollection
TableName
typedPlural
DataRow
TableNameRow
typedName
DataColumn
DataTable.ColumnNameColumn

DataRow.ColumnName
typedName
Property
PropertyName
typedName
Child Accessor
GetChildTableNameRows
typedChildren
Parent Accessor
TableNameRow
typedParent
DataSet Events
TableNameRowChangeEvent 

TableNameRowChangeEventHandler
typedName
Table B-2. codegen atttributes

Attribute

Description

typedName

Name of the object in the generated class.

typedPlural

The name of the ...

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