语言

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。

特性

适用于