DataContext.DeleteDatabase 方法

定義

刪除關聯的資料庫。Deletes the associated database.

public:
 void DeleteDatabase();
public void DeleteDatabase ();
member this.DeleteDatabase : unit -> unit
Public Sub DeleteDatabase ()

範例

下列範例顯示如何刪除已暫時建立的資料庫。The following example shows how to delete a database that has been temporarily created.

if (!db.DatabaseExists())
    db.CreateDatabase();
// …
db.DeleteDatabase();
If Not db.DatabaseExists Then
    db.CreateDatabase()
End If
' ...
db.DeleteDatabase()

備註

這個方法會使用Connection屬性中的連接,來識別要刪除的資料庫。This method uses the connection in the Connection property to identify the database to be deleted.

適用於

另請參閱