SqlCacheDependencyDatabase.ConnectionStringName Property

 

Gets or sets the connection name for the database.

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

<ConfigurationPropertyAttribute("connectionStringName", IsRequired := True)>
<StringValidatorAttribute(MinLength := 1)>
Public Property ConnectionStringName As String

Property Value

Type: System.String

A string that specifies the name of a database connection string within the connectionStrings configuration section.

The ConnectionStringName property allows you to programmatically access and modify the connectionName attribute of an add element of the databases node in a configuration file. The connection name identifies an element in the connectionStrings section which contains the database connection string.

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

' Get the current ConnectionStringName property value.
Dim connectionNameValue As String = sqlCdd.ConnectionStringName

' Set the ConnectionName property. This is the database name.
  sqlCdd.ConnectionStringName = "DataBaseName"

.NET Framework
Available since 2.0
Return to top
Show: