共用方式為


ConnectionStringSettings.ConnectionString 屬性

定義

取得或設定連接字串。

public:
 property System::String ^ ConnectionString { System::String ^ get(); void set(System::String ^ value); };
[System.Configuration.ConfigurationProperty("connectionString", DefaultValue="", Options=System.Configuration.ConfigurationPropertyOptions.IsRequired)]
public string ConnectionString { get; set; }
public string ConnectionString { get; set; }
[<System.Configuration.ConfigurationProperty("connectionString", DefaultValue="", Options=System.Configuration.ConfigurationPropertyOptions.IsRequired)>]
member this.ConnectionString : string with get, set
member this.ConnectionString : string with get, set
Public Property ConnectionString As String

屬性值

指派給 ConnectionString 屬性的字串值。

屬性

範例

下列範例將示範如何使用 ConnectionString 屬性。

Console.WriteLine("  Connection String: \"{0}\"",
    cs.ConnectionString);
Console.WriteLine( _
"  Connection String: ""{0}""", cs.ConnectionString)

適用於

另請參閱