ExtendedProperties
PropertyCollection props
= DataRelation.ExtendedProperties;
Contains a PropertyCollection
that can store any
amount of miscellaneous information about the
DataRelation
. For example, you can store
information about the parent and child columns or how the
relationship should be validated according to custom validation
functions you may have created. The information in the
ExtendedProperties
collection is for use by your
code only; it isn’t used by the .NET framework
(although any strings you add to the
PropertyCollection
are retained in serialized
DataSet
XML.
The ProperyCollection
is a name/value dictionary
that derives from the Hashtable
class. Most
disconnected data objects provide an
ExtendedProperties
collection, including the
DataSet
, DataColumn
,
DataTable
, and Constraint
classes.
The following code snippet stores the data type of the child
DataColumn
in the
PropertyCollection
:
// Determine the data type for the linked column. Type dataType = dr.ChildColumns[0].DataType; // Store it in the extended properties for future reference. dr.ExtendedProperties["ColumnDataType"] = dataType.ToString();