Skip to main content
.NET Framework Class Library
DataTable..::.ExtendedProperties Property

Gets the collection of customized user information.

Namespace: System.Data
Assembly: System.Data (in System.Data.dll)
Syntax
<BrowsableAttribute(False)> _
Public ReadOnly Property ExtendedProperties As PropertyCollection
[BrowsableAttribute(false)]
public PropertyCollection ExtendedProperties { get; }
[BrowsableAttribute(false)]
public:
property PropertyCollection^ ExtendedProperties {
	PropertyCollection^ get ();
}
[<BrowsableAttribute(false)>]
member ExtendedProperties : PropertyCollection

Property Value

Type: System.Data..::.PropertyCollection
A PropertyCollection that contains custom user information.
Remarks

Use the ExtendedProperties to add custom information to a DataTable. Add information with the Add method. Retrieve information with the Item method.

Extended properties must be of type String. Properties that are not of type String are not persisted when the DataTable is written as XML.

Examples

The following example adds a timestamp value to the DataTable through the ExtendedProperties property.


Private Sub GetAndSetExtendedProperties(ByVal myTable As DataTable)
   ' Add an item to the collection.
   myTable.ExtendedProperties.Add("TimeStamp", DateTime.Now)
   ' Print the item.
   Console.WriteLine(myTable.ExtendedProperties.Item("TimeStamp"))
End Sub


private void GetAndSetExtendedProperties(DataTable myTable){
   // Add an item to the collection.
   myTable.ExtendedProperties.Add("TimeStamp", DateTime.Now);
   // Print the item.
   Console.WriteLine(myTable.ExtendedProperties["TimeStamp"]);
}

Version Information

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Platforms

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.