EntityConnection.ConnectionString 屬性
[此頁面專屬於 Entity Framework 第 6 版。最新版本可從 'Entity Framework' NuGet 套件取得。如需 Entity Framework 的詳細資訊,請參閱 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