DbProviderServices.DbDatabaseExists-Methode (DbConnection, Nullable<Int32>, StoreItemCollection)
[Diese Seite bezieht sich auf Entity Framework Version 6. Die neueste Version ist als 'Entity Framework' NuGet-Paket verfügbar. Weitere Informationen zu Entity Framework finden Sie unter msdn.com/data/ef.]
Gibt einen Wert zurück, der angibt, ob eine bestimmte Datenbank auf dem Server vorhanden ist.
Namespace: System.Data.Entity.Core.Common
Assembly: EntityFramework (in EntityFramework.dll)
Syntax
'Declaration
Protected Overridable Function DbDatabaseExists ( _
connection As DbConnection, _
commandTimeout As Nullable(Of Integer), _
storeItemCollection As StoreItemCollection _
) As Boolean
'Usage
Dim connection As DbConnection
Dim commandTimeout As Nullable(Of Integer)
Dim storeItemCollection As StoreItemCollection
Dim returnValue As Boolean
returnValue = Me.DbDatabaseExists(connection, _
commandTimeout, storeItemCollection)
protected virtual bool DbDatabaseExists(
DbConnection connection,
Nullable<int> commandTimeout,
StoreItemCollection storeItemCollection
)
protected:
virtual bool DbDatabaseExists(
DbConnection^ connection,
Nullable<int> commandTimeout,
StoreItemCollection^ storeItemCollection
)
abstract DbDatabaseExists :
connection:DbConnection *
commandTimeout:Nullable<int> *
storeItemCollection:StoreItemCollection -> bool
override DbDatabaseExists :
connection:DbConnection *
commandTimeout:Nullable<int> *
storeItemCollection:StoreItemCollection -> bool
protected function DbDatabaseExists(
connection : DbConnection,
commandTimeout : Nullable<int>,
storeItemCollection : StoreItemCollection
) : boolean
Parameter
- connection
Typ: System.Data.Common.DbConnection
Verbindung mit einer Datenbank, deren Existenz mithilfe dieser Methode überprüft wird.
- commandTimeout
Typ: System.Nullable<Int32>
Ausführungstimeout für Befehle, die zum Bestimmen der Existenz der Datenbank benötigt werden.
- storeItemCollection
Typ: System.Data.Entity.Core.Metadata.Edm.StoreItemCollection
Die Auflistung aller Speicherelemente aus dem Modell. Dieser Parameter wird nicht mehr zur Bestimmung der Datenbankexistenz verwendet.
Rückgabewert
Typ: System.Boolean
True, wenn der Anbieter die Datenbank nur auf Grundlage der Verbindung herleiten kann.