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)

适用于

另请参阅