DbProviderServices.DatabaseExists(DbConnection, Nullable<Int32>, StoreItemCollection) Method

Definition

返回一个值,该值指示服务器上是否存在给定数据库以及是否创建了 storeItemCollection 中包含的架构对象。Returns a value indicating whether a given database exists on the server and whether schema objects contained in the storeItemCollection have been created.

public:
 bool DatabaseExists(System::Data::Common::DbConnection ^ connection, Nullable<int> commandTimeout, System::Data::Metadata::Edm::StoreItemCollection ^ storeItemCollection);
public bool DatabaseExists (System.Data.Common.DbConnection connection, int? commandTimeout, System.Data.Metadata.Edm.StoreItemCollection storeItemCollection);
member this.DatabaseExists : System.Data.Common.DbConnection * Nullable<int> * System.Data.Metadata.Edm.StoreItemCollection -> bool
Public Function DatabaseExists (connection As DbConnection, commandTimeout As Nullable(Of Integer), storeItemCollection As StoreItemCollection) As Boolean

Parameters

connection
DbConnection

到某个数据库的连接,该数据库是否存在可通过此方法进行验证。Connection to a database whose existence is verified by this method.

commandTimeout
Nullable<Int32>

确定数据库是否存在所需的任何命令的执行超时。Execution timeout for any commands needed to determine the existence of the database.

storeItemCollection
StoreItemCollection

通过此方法确定其是否存在的数据库中包含的所有存储项的集合。The collection of all store items contained in the database whose existence is determined by this method.

Returns

Boolean

如果提供程序仅基于连接就可推导数据库,则为 truetrue if the provider can deduce the database only based on the connection.

Applies to