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)