public RenameDatabase ( short oldName, short newName ) : void | ||
oldName | short | The old name of the Database. If a Database
/// with this name does not exist, the function will throw
/// |
newName | short | The new name of the Database. If a Database
/// with this name already exists, the function will throw
/// |
return | void |
private void RenameDatabase() { Upscaledb.Environment env = new Upscaledb.Environment(); byte[] k = new byte[5]; byte[] r = new byte[5]; try { env.Create("ntest.db"); Database db = env.CreateDatabase((short)13); db.Insert(k, r); db.Close(); env.RenameDatabase((short)13, (short)15); db = env.OpenDatabase((short)15); byte[] f = db.Find(k); checkEqual(r, f); // db.Close(); env.Close(); } catch (DatabaseException e) { Assert.Fail("unexpected exception " + e); } }
private void RenameDatabase() { Upscaledb.Environment env = new Upscaledb.Environment(); byte[] k = new byte[5]; byte[] r = new byte[5]; try { env.Create("ntest.db"); Database db = env.CreateDatabase((short)13); db.Insert(k, r); db.Close(); env.RenameDatabase((short)13, (short)15); db = env.OpenDatabase((short)15); byte[] f = db.Find(k); checkEqual(r, f); // db.Close(); env.Close(); } catch (DatabaseException e) { Assert.Fail("unexpected exception " + e); } }