Прочетете на английски Редактиране

Споделяне чрез


DbProviderServices.DbDatabaseExists Method

Definition

Returns a value indicating whether a given database exists on the server and whether schema objects contained in the storeItemCollection have been created.

C#
protected virtual bool DbDatabaseExists(System.Data.Common.DbConnection connection, int? commandTimeout, System.Data.Metadata.Edm.StoreItemCollection storeItemCollection);

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 structure of the database whose existence is determined by this method.

Returns

true if the database indicated by the connection and the storeItemCollection parameter exists; otherwise, false.

Applies to

Продукт Версии
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1