SectionInformation.GetParentSection Method ()


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

Gets the configuration section that contains the configuration section associated with this object.

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

public ConfigurationSection GetParentSection()

Return Value

Type: System.Configuration.ConfigurationSection

The configuration section that contains the ConfigurationSection that is associated with this SectionInformation object.

Exception Condition

The method is invoked from a parent section.

If this ConfigurationSection object has no parent sections, the GetParentSection method returns the same value as the Name property.

The following example shows how to use the GetParentSection method.

static public void GetParentSection()
    SectionInformation sInfo = 

    ConfigurationSection parentSection =

    Console.WriteLine("Parent section : {0}",


.NET Framework
Available since 2.0
Return to top