public EraseDatabase ( short name ) : void | ||
name | short | The name of the Database which is deleted.
/// If a Database with this name does not exist, the function will throw
/// |
return | void |
public void EraseDatabase(short name)
{
int st;
lock (this) {
st = NativeMethods.EnvEraseDatabase(handle, name, 0);
}
if (st != 0)
throw new DatabaseException(st);
}
private void EraseUnknownDatabase() { Upscaledb.Environment env = new Upscaledb.Environment(); byte[] k = new byte[5]; byte[] r = new byte[5]; env.Create("ntest.db"); Database db = env.CreateDatabase((short)13); db.Insert(k, r); db.Close(); try { env.EraseDatabase((short)99); } catch (DatabaseException e) { Assert.AreEqual(UpsConst.UPS_DATABASE_NOT_FOUND, e.ErrorCode); } env.Close(); }