共用方式為


SqlCacheDependencyDatabase.ConnectionStringName 屬性

定義

取得或設定資料庫的連接名稱。

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

屬性值

字串,指定 connectionStrings 組態區段內的資料庫連接字串的名稱。

屬性

範例

下列程式碼範例示範如何使用 ConnectionStringName 屬性。


// 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"

備註

屬性 ConnectionStringName 可讓您以程式設計方式存取和修改 connectionNameadd 組態檔中節點元素 databases 的屬性。 連接名稱會識別區段中包含資料庫連接字串的專案 connectionStrings

適用於

另請參閱