共用方式為


ObjectContext.DatabaseExists 方法

定義

檢查指定為目前存放區連接中資料庫的資料庫是否存在於存放區上。 大部分的實際工作都是由目前存放區連線的 DbProviderServices 實作來完成。

[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")]
public virtual bool DatabaseExists ();
abstract member DatabaseExists : unit -> bool
override this.DatabaseExists : unit -> bool
Public Overridable Function DatabaseExists () As Boolean

傳回

如果資料庫存在,則為 true;否則為 false。

屬性

適用於