共用方式為


EntityConnection.DataSource 屬性

[此頁面專屬於 Entity Framework 第 6 版。最新版本可從 'Entity Framework' NuGet 套件取得。如需 Entity Framework 的詳細資訊,請參閱 msdn.com/data/ef。]

取得要連接到的資料來源的名稱或網路地址。

命名空間:  System.Data.Entity.Core.EntityClient
組件:  EntityFramework (在 EntityFramework.dll 中)

語法

'宣告
<SuppressMessageAttribute("Microsoft.Design", "CA1065:DoNotRaiseExceptionsInUnexpectedLocations")> _
Public Overrides ReadOnly Property DataSource As String 
    Get
'用途
Dim instance As EntityConnection 
Dim value As String 

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

屬性值

類型:System.String
資料來源的名稱。預設值為空字串。

請參閱

參考

EntityConnection 類別

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