Table of Contents

Method EmptyDatabase

Namespace
YndigoBlue.Velocity.Engine
Assembly
YndigoBlue.Velocity.dll

EmptyDatabase(Database, bool)

Removes all tables, views, constraints, and indexes from all schemas in the database, leaving empty schemas.

public void EmptyDatabase(Database database, bool ignoreFailures = false)

Parameters

database Database

The Database object containing the schemas to empty.

ignoreFailures bool

If true, continues execution even if individual drop operations fail.

Examples

using (var m = new Manager(conn))
{
    var database = m.LoadDatabase();
    m.EmptyDatabase(database, ignoreFailures: true);
    Console.WriteLine("All schemas emptied");
}

Exceptions

DbException

Thrown when a database error occurs (unless ignoreFailures is true).