Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

WebConfigurationManager::ConnectionStrings Property

 

Gets the Web site's connection strings.

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

public:
property ConnectionStringSettingsCollection^ ConnectionStrings {
	static ConnectionStringSettingsCollection^ get();
}

Property Value

Type: System.Configuration::ConnectionStringSettingsCollection^

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

Exception Condition
ConfigurationErrorsException

A valid ConnectionStringSettingsCollection object could not be retrieved.

The following example shows how to use the ConnectionStrings property to access configuration information and enumerate the results. To access a specific connection string, use the returned ConnectionStringSettingsCollection with the name of the desired connection string as an indexer.

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

.NET Framework
Available since 2.0
Return to top
Show: