DbProviderServices.DbDatabaseExists 方法

定义

返回一个值,该值指示服务器上是否存在给定数据库,以及是否已创建 storeItemCollection 中包含的架构对象。

protected:
 virtual bool DbDatabaseExists(System::Data::Common::DbConnection ^ connection, Nullable<int> commandTimeout, System::Data::Metadata::Edm::StoreItemCollection ^ storeItemCollection);
protected virtual bool DbDatabaseExists(System.Data.Common.DbConnection connection, int? commandTimeout, System.Data.Metadata.Edm.StoreItemCollection storeItemCollection);
abstract member DbDatabaseExists : System.Data.Common.DbConnection * Nullable<int> * System.Data.Metadata.Edm.StoreItemCollection -> bool
override this.DbDatabaseExists : System.Data.Common.DbConnection * Nullable<int> * System.Data.Metadata.Edm.StoreItemCollection -> bool
Protected Overridable Function DbDatabaseExists (connection As DbConnection, commandTimeout As Nullable(Of Integer), storeItemCollection As StoreItemCollection) As Boolean

参数

connection
DbConnection

与此方法验证其存在的数据库的连接。

commandTimeout
Nullable<Int32>

确定数据库是否存在所需的任何命令的执行超时。

storeItemCollection
StoreItemCollection

其存在由此方法确定的数据库的结构。

返回

true 如果连接和 storeItemCollection 参数指示的数据库存在,则为 ;否则,为 false.

适用于