Database.Exists Method (DbConnection)
[This page is specific to the Entity Framework version 6. The latest version is available as the 'Entity Framework' NuGet package. For more information about Entity Framework, see msdn.com/data/ef.]
Checks whether or not the database exists on the server.
Namespace: System.Data.Entity
Assembly: EntityFramework (in EntityFramework.dll)
Syntax
'Declaration
Public Shared Function Exists ( _
existingConnection As DbConnection _
) As Boolean
'Usage
Dim existingConnection As DbConnection
Dim returnValue As Boolean
returnValue = Database.Exists(existingConnection)
public static bool Exists(
DbConnection existingConnection
)
public:
static bool Exists(
DbConnection^ existingConnection
)
static member Exists :
existingConnection:DbConnection -> bool
public static function Exists(
existingConnection : DbConnection
) : boolean
Parameters
- existingConnection
Type: System.Data.Common.DbConnection
An existing connection to the database.
Return Value
Type: System.Boolean
True if the database exists; false otherwise.