語言

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

傳回

若資料庫存在則為真;否則,則為錯誤。

屬性

適用於