ConfigurationManager.ConnectionStrings Property

Gets the ConnectionStringsSection data for the current application's default configuration.

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

public:
static property ConnectionStringSettingsCollection^ ConnectionStrings {
	ConnectionStringSettingsCollection^ get ();
}
/** @property */
public static ConnectionStringSettingsCollection get_ConnectionStrings ()

public static function get ConnectionStrings () : ConnectionStringSettingsCollection

Not applicable.

Property Value

Returns a ConnectionStringSettingsCollection object that contains the contents of the ConnectionStringsSection object for the current application's default configuration.

Exception typeCondition

ConfigurationErrorsException

Could not retrieve a ConnectionStringSettingsCollection object.

A ConnectionStringsSection object contains the contents of the configuration file's connectionStrings section.

The following code example shows how to use the ConnectionStrings property.

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

Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0

Community Additions

ADD
Show: