Share via


Database.Exists 方法

[本页针对的是实体框架版本 6。最新版本以“实体框架”NuGet 包的形式提供。有关实体框架的更多信息,请参见 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 命名空间