Edytuj

Udostępnij za pośrednictwem


SqlCacheDependencyDatabase.ConnectionStringName Property

Definition

Gets or sets the connection name for the database.

public:
 property System::String ^ ConnectionStringName { System::String ^ get(); void set(System::String ^ value); };
[System.Configuration.ConfigurationProperty("connectionStringName", IsRequired=true)]
[System.Configuration.StringValidator(MinLength=1)]
public string ConnectionStringName { get; set; }
[<System.Configuration.ConfigurationProperty("connectionStringName", IsRequired=true)>]
[<System.Configuration.StringValidator(MinLength=1)>]
member this.ConnectionStringName : string with get, set
Public Property ConnectionStringName As String

Property Value

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

Attributes

Examples

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


// Get the current ConnectionStringName property value.
string connectionNameValue = sqlCdd.ConnectionStringName;

// Set the ConnectionName property. This is the database name.
sqlCdd.ConnectionStringName = "DataBaseName";
' Get the current ConnectionStringName property value.
Dim connectionNameValue As String = sqlCdd.ConnectionStringName

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

Remarks

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.

Applies to

See also