This topic has not yet been rated - Rate this topic

GetCollection Method (Type)

Returns the configuration element that has the specified type and is under the current configuration element.

Namespace:  Microsoft.Web.Administration
Assembly:  Microsoft.Web.Administration (in Microsoft.Web.Administration.dll)
public ConfigurationElement GetCollection(
	Type collectionType
)

Parameters

collectionType
Type: System..::..Type
The common language runtime (CLR) type of the collection this method should return.
ExceptionCondition
ArgumentNullException

The collectionType parameter is nullNothingnullptrunita null reference (Nothing in Visual Basic) or empty.

A child element collection that is represented in the ChildElements property differs from a nested element collection that is represented by the return value of the GetCollection method. Both collections contain ConfigurationElement objects. However, you should use the ChildElements property when you query the configuration for unique child elements such as the system.webServer/asp configuration section. You should use the GetCollection method when you query the configuration for collection elements that contain a unique key or a multi-attribute key, such as the system.webServer/sites configuration section

Did you find this helpful?
(1500 characters remaining)

Community Additions

ADD
© 2013 Microsoft. All rights reserved.