Share via


Database.Delete 方法 (DbConnection)

[此頁面專屬於 Entity Framework 第 6 版。最新版本可從 'Entity Framework' NuGet 套件取得。如需 Entity Framework 的詳細資訊,請參閱 msdn.com/data/ef。]

如果資料庫伺服器上有資料庫則將它刪除,否則不執行任何動作。

命名空間:  System.Data.Entity
組件:  EntityFramework (在 EntityFramework.dll 中)

語法

'宣告
Public Shared Function Delete ( _
    existingConnection As DbConnection _
) As Boolean
'用途
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

參數

傳回值

類型:System.Boolean
如果資料庫存在但是已刪除則為 true,否則為 false。

請參閱

參考

Database 類別

Delete 多載

System.Data.Entity 命名空間