PropertyCollection Class
TOC
Collapse the table of content
Expand the table of content

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)

System.Object
  System.Collections.Hashtable
    System.Data.PropertyCollection

<SerializableAttribute>
Public Class PropertyCollection
	Inherits Hashtable

NameDescription
System_CAPS_pubmethodPropertyCollection()

Initializes a new instance of the PropertyCollection class.

System_CAPS_protmethodPropertyCollection(SerializationInfo, StreamingContext)

Initializes a new instance of the PropertyCollection class.

NameDescription
System_CAPS_protpropertycomparer

Obsolete.Gets or sets the IComparer to use for the Hashtable.(Inherited from Hashtable.)

System_CAPS_pubpropertyCount

Gets the number of key/value pairs contained in the Hashtable.(Inherited from Hashtable.)

System_CAPS_protpropertyEqualityComparer

Gets the IEqualityComparer to use for the Hashtable.(Inherited from Hashtable.)

System_CAPS_protpropertyhcp

Obsolete.Gets or sets the object that can dispense hash codes.(Inherited from Hashtable.)

System_CAPS_pubpropertyIsFixedSize

Gets a value indicating whether the Hashtable has a fixed size.(Inherited from Hashtable.)

System_CAPS_pubpropertyIsReadOnly

Gets a value indicating whether the Hashtable is read-only.(Inherited from Hashtable.)

System_CAPS_pubpropertyIsSynchronized

Gets a value indicating whether access to the Hashtable is synchronized (thread safe).(Inherited from Hashtable.)

System_CAPS_pubpropertyItem(Object)

Gets or sets the value associated with the specified key.(Inherited from Hashtable.)

System_CAPS_pubpropertyKeys

Gets an ICollection containing the keys in the Hashtable.(Inherited from Hashtable.)

System_CAPS_pubpropertySyncRoot

Gets an object that can be used to synchronize access to the Hashtable.(Inherited from Hashtable.)

System_CAPS_pubpropertyValues

Gets an ICollection containing the values in the Hashtable.(Inherited from Hashtable.)

NameDescription
System_CAPS_pubmethodAdd(Object, Object)

Adds an element with the specified key and value into the Hashtable.(Inherited from Hashtable.)

System_CAPS_pubmethodClear()

Removes all elements from the Hashtable.(Inherited from Hashtable.)

System_CAPS_pubmethodClone()

Creates a shallow copy of the PropertyCollection object.(Overrides Hashtable.Clone().)

System_CAPS_pubmethodContains(Object)

Determines whether the Hashtable contains a specific key.(Inherited from Hashtable.)

System_CAPS_pubmethodContainsKey(Object)

Determines whether the Hashtable contains a specific key.(Inherited from Hashtable.)

System_CAPS_pubmethodContainsValue(Object)

Determines whether the Hashtable contains a specific value.(Inherited from Hashtable.)

System_CAPS_pubmethodCopyTo(Array, Int32)

Copies the Hashtable elements to a one-dimensional Array instance at the specified index.(Inherited from Hashtable.)

System_CAPS_pubmethodEquals(Object)

Determines whether the specified object is equal to the current object.(Inherited from Object.)

System_CAPS_protmethodFinalize()

Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.)

System_CAPS_pubmethodGetEnumerator()

Returns an IDictionaryEnumerator that iterates through the Hashtable.(Inherited from Hashtable.)

System_CAPS_protmethodGetHash(Object)

Returns the hash code for the specified key.(Inherited from Hashtable.)

System_CAPS_pubmethodGetHashCode()

Serves as the default hash function. (Inherited from Object.)

System_CAPS_pubmethodGetObjectData(SerializationInfo, StreamingContext)

Implements the ISerializable interface and returns the data needed to serialize the Hashtable.(Inherited from Hashtable.)

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_protmethodKeyEquals(Object, Object)

Compares a specific Object with a specific key in the Hashtable.(Inherited from Hashtable.)

System_CAPS_protmethodMemberwiseClone()

Creates a shallow copy of the current Object.(Inherited from Object.)

System_CAPS_pubmethodOnDeserialization(Object)

Implements the ISerializable interface and raises the deserialization event when the deserialization is complete.(Inherited from Hashtable.)

System_CAPS_pubmethodRemove(Object)

Removes the element with the specified key from the Hashtable.(Inherited from Hashtable.)

System_CAPS_pubmethodToString()

Returns a string that represents the current object.(Inherited from Object.)

NameDescription
System_CAPS_pubinterfaceSystem_CAPS_privmethodIEnumerable.GetEnumerator()

Returns an enumerator that iterates through a collection.(Inherited from Hashtable.)

NameDescription
System_CAPS_pubmethodAsParallel()

Overloaded. Enables parallelization of a query.(Defined by ParallelEnumerable.)

System_CAPS_pubmethodAsQueryable()

Overloaded. Converts an IEnumerable to an IQueryable.(Defined by Queryable.)

System_CAPS_pubmethodCast(Of TResult)()

Casts the elements of an IEnumerable to the specified type.(Defined by Enumerable.)

System_CAPS_pubmethodOfType(Of TResult)()

Filters the elements of an IEnumerable based on a specified type.(Defined by Enumerable.)

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
Available since 1.1

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

Return to top
Show:
© 2016 Microsoft