Export (0) Print
Expand All

PropertyCollection Class

Represents a collection of properties that can be added to DataColumn, DataSet, or DataTable.

Namespace:  System.Data
Assembly:  System.Data (in System.Data.dll)

'Declaration
<SerializableAttribute> _
Public Class PropertyCollection _
	Inherits Hashtable

The PropertyCollection type exposes the following members.

  NameDescription
Public methodSupported by the XNA FrameworkPropertyCollectionInitializes a new instance of the PropertyCollection class.
Protected methodPropertyCollection(SerializationInfo, StreamingContext)Initializes a new instance of the PropertyCollection class.
Top

  NameDescription
Protected propertySupported by the XNA Frameworkcomparer Obsolete. Gets or sets the IComparer to use for the Hashtable. (Inherited from Hashtable.)
Public propertySupported by the XNA FrameworkCountGets the number of key/value pairs contained in the Hashtable. (Inherited from Hashtable.)
Protected propertySupported by the XNA FrameworkEqualityComparerGets the IEqualityComparer to use for the Hashtable. (Inherited from Hashtable.)
Protected propertySupported by the XNA Frameworkhcp Obsolete. Gets or sets the object that can dispense hash codes. (Inherited from Hashtable.)
Public propertySupported by the XNA FrameworkIsFixedSizeGets a value indicating whether the Hashtable has a fixed size. (Inherited from Hashtable.)
Public propertySupported by the XNA FrameworkIsReadOnlyGets a value indicating whether the Hashtable is read-only. (Inherited from Hashtable.)
Public propertySupported by the XNA FrameworkIsSynchronizedGets a value indicating whether access to the Hashtable is synchronized (thread safe). (Inherited from Hashtable.)
Public propertySupported by the XNA FrameworkItemGets or sets the value associated with the specified key. (Inherited from Hashtable.)
Public propertySupported by the XNA FrameworkKeysGets an ICollection containing the keys in the Hashtable. (Inherited from Hashtable.)
Public propertySupported by the XNA FrameworkSyncRootGets an object that can be used to synchronize access to the Hashtable. (Inherited from Hashtable.)
Public propertySupported by the XNA FrameworkValuesGets an ICollection containing the values in the Hashtable. (Inherited from Hashtable.)
Top

  NameDescription
Public methodSupported by the XNA FrameworkAddAdds an element with the specified key and value into the Hashtable. (Inherited from Hashtable.)
Public methodSupported by the XNA FrameworkClearRemoves all elements from the Hashtable. (Inherited from Hashtable.)
Public methodSupported by the XNA FrameworkCloneCreates a shallow copy of the PropertyCollection object. (Overrides Hashtable.Clone.)

In .NET Framework Client Profile 4, this member is inherited from Hashtable.Clone.


In XNA Framework 3.0, this member is inherited from Hashtable.Clone.
Public methodSupported by the XNA FrameworkContainsDetermines whether the Hashtable contains a specific key. (Inherited from Hashtable.)
Public methodSupported by the XNA FrameworkContainsKeyDetermines whether the Hashtable contains a specific key. (Inherited from Hashtable.)
Public methodSupported by the XNA FrameworkContainsValueDetermines whether the Hashtable contains a specific value. (Inherited from Hashtable.)
Public methodSupported by the XNA FrameworkCopyToCopies the Hashtable elements to a one-dimensional Array instance at the specified index. (Inherited from Hashtable.)
Public methodSupported by the XNA FrameworkEquals(Object)Determines whether the specified object is equal to the current object. (Inherited from Object.)
Protected methodSupported by the XNA FrameworkFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodSupported by the XNA FrameworkGetEnumeratorReturns an IDictionaryEnumerator that iterates through the Hashtable. (Inherited from Hashtable.)
Protected methodSupported by the XNA FrameworkGetHashReturns the hash code for the specified key. (Inherited from Hashtable.)
Public methodSupported by the XNA FrameworkGetHashCodeServes as the default hash function. (Inherited from Object.)
Public methodGetObjectDataImplements the ISerializable interface and returns the data needed to serialize the Hashtable. (Inherited from Hashtable.)
Public methodSupported by the XNA FrameworkGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodSupported by the XNA FrameworkKeyEqualsCompares a specific Object with a specific key in the Hashtable. (Inherited from Hashtable.)
Protected methodSupported by the XNA FrameworkMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodOnDeserializationImplements the ISerializable interface and raises the deserialization event when the deserialization is complete. (Inherited from Hashtable.)
Public methodSupported by the XNA FrameworkRemoveRemoves the element with the specified key from the Hashtable. (Inherited from Hashtable.)
Public methodSupported by the XNA FrameworkToStringReturns a string that represents the current object. (Inherited from Object.)
Top

  NameDescription
Explicit interface implemetationPrivate methodSupported by the XNA FrameworkIEnumerable.GetEnumeratorReturns an enumerator that iterates through a collection. (Inherited from Hashtable.)
Top

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 creates a timestamp value for a DataTable and adds it to the PropertyCollection.

Private Sub AddTimeStamp()
    'Create a new DataTable. 
    Dim table As New DataTable("NewTable")

    'Get its PropertyCollection. 
    Dim properties As PropertyCollection = table.ExtendedProperties

    'Add a timestamp value to the PropertyCollection.
    properties.Add("TimeStamp", DateTime.Now)

    'Print the timestamp.
    Console.WriteLine(properties("TimeStamp"))
End Sub

.NET Framework

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

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

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

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show:
© 2014 Microsoft