ConnectionStringSettings.ConnectionString 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得或設定連接字串。
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)