System.Data Namespace
Represents a collection of properties that can be added to DataColumn, DataSet, or DataTable.
Visibility |
Name |
Parameters |
Return Type |
public |
Clone |
( )
|
Object
|
|
The PropertyCollection can be accessed through the ExtendedProperties property of the DataColumn, DataSet, or DataTable class.
Add custom properties to the DataColumn, DataSet, or DataTable objects through the PropertyCollection. For example, you may want to store the time of the object' s creation for later comparison to another object.
The following example initializes a custom password for a DataTable and adds it to the PropertyCollection.
private void AddPassWord ( ) {
PropertyCollection p;
// create a new DataTable.
DataTable dt = new DataTable ( "myNewTable" );
// get its PropertyCollection.
p = dt.ExtendedProperties;
// add a password to the PropertyCollection.
p.Add ( "myPassword", "yervzeñun" );
// print the password.
Response.Write ( dt.ExtendedProperties [ "myPassword" ] );
}
Private Sub AddPassWord ( )
Dim p As PropertyCollection
' create a new DataTable.
Dim dt As New DataTable ( "myNewTable" )
' get its PropertyCollection.
p = dt.ExtendedProperties
' add a password to the PropertyCollection.
p.Add ( "myPassword", "yervzeñun" )
' print the password.
Response.Write ( dt.ExtendedProperties ( "myPassword" ) )
End Sub |
|
C# |
VB |
DataColumn DataSet DataTable DataColumn.ExtendedProperties DataSet.ExtendedProperties DataTable.ExtendedProperties