NameObjectCollectionBase.BaseGet Method (String)


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Gets the value of the first entry with the specified key from the NameObjectCollectionBase instance.

Namespace:   System.Collections.Specialized
Assembly:  System (in System.dll)

member BaseGet : 
        name:string -> Object


Type: System.String

The String key of the entry to get. The key can be null.

Return Value

Type: System.Object

An Object that represents the value of the first entry with the specified key, if found; otherwise, null.

If the collection contains multiple entries with the specified key, this method returns only the first entry. To get the values of subsequent entries with the same key, use the enumerator to iterate through the collection and compare the keys.


This method returns null in the following cases: 1) if the specified key is not found; and 2) if the specified key is found and its associated value is null. This method does not distinguish between the two cases.

This method is an O(1) operation.

The following code example uses BaseGetKey and BaseGet to get specific keys and values.

No code example is currently available or this language may not be supported.

Universal Windows Platform
Available since 10
.NET Framework
Available since 1.1
Return to top