Database.Delete 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.]
Deletes the database on the database server if it exists, otherwise does nothing.
Namespace: System.Data.Entity
Assembly: EntityFramework (in EntityFramework.dll)
Syntax
'Declaration
Public Shared Function Delete ( _
existingConnection As DbConnection _
) As Boolean
'Usage
Dim existingConnection As DbConnection
Dim returnValue As Boolean
returnValue = Database.Delete(existingConnection)
public static bool Delete(
DbConnection existingConnection
)
public:
static bool Delete(
DbConnection^ existingConnection
)
static member Delete :
existingConnection:DbConnection -> bool
public static function Delete(
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 did exist and was deleted; false otherwise.