Share via


Database.Exists 方法

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

檢查資料庫是否存在伺服器上。

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

語法

'宣告
Public Function Exists As Boolean
'用途
Dim instance As Database 
Dim returnValue As Boolean 

returnValue = instance.Exists()
public bool Exists()
public:
bool Exists()
member Exists : unit -> bool
public function Exists() : boolean

傳回值

類型:System.Boolean
如果資料庫存在則為 true,否則為 false。

請參閱

參考

Database 類別

Exists 多載

System.Data.Entity 命名空間