EntityConnection.ConnectionString 属性

[本页针对的是实体框架版本 6。最新版本以“实体框架”NuGet 包的形式提供。有关实体框架的更多信息,请参见 msdn.com/data/ef。]

获取或设置 EntityConnection 连接字符串。

命名空间:  System.Data.Entity.Core.EntityClient
程序集:  EntityFramework(在 EntityFramework.dll 中)

语法

声明
<SuppressMessageAttribute("Microsoft.Design", "CA1065:DoNotRaiseExceptionsInUnexpectedLocations")> _
Public Overrides Property ConnectionString As String 
    Get 
    Set
用法
Dim instance As EntityConnection 
Dim value As String 

value = instance.ConnectionString

instance.ConnectionString = value
[SuppressMessageAttribute("Microsoft.Design", "CA1065:DoNotRaiseExceptionsInUnexpectedLocations")]
public override string ConnectionString { get; set; }
[SuppressMessageAttribute(L"Microsoft.Design", L"CA1065:DoNotRaiseExceptionsInUnexpectedLocations")]
public:
virtual property String^ ConnectionString {
    String^ get () override;
    void set (String^ value) override;
}
[<SuppressMessageAttribute("Microsoft.Design", "CA1065:DoNotRaiseExceptionsInUnexpectedLocations")>]
abstract ConnectionString : string with get, set
[<SuppressMessageAttribute("Microsoft.Design", "CA1065:DoNotRaiseExceptionsInUnexpectedLocations")>]
override ConnectionString : string with get, set
override function get ConnectionString () : String 
override function set ConnectionString (value : String)

属性值

类型:System.String
建立与数据源的初始连接所需的连接字符串。默认值为一个空字符串。连接关闭时,将返回当前设置的值。如果未设置任何值,则将返回一个空字符串。

Implements

IDbConnection.ConnectionString

请参阅

参考

EntityConnection 类

System.Data.Entity.Core.EntityClient 命名空间