Product Documentation

c-treeDB API for C# - Developers Guide

Previous Topic

Next Topic

Deleting a Table

When you delete a table from a database, the table information is removed from the database dictionary and the table data and index files are deleted from disk. The delete table operation can be reversed only when used under transaction control. Without transaction control, a delete table operation will delete the data and index files and the table data will be lost. Delete a table from a database by calling CTDatabase.DeleteTable() method. Example:

// delete MyTable from current database

try

{

string password = "";

ADatabase.DeleteTable("MyTable", password);

}

catch (CTException err)

{

Console.Write("Delete table failed with code {0}\n", err.GetErrorCode());

}

Note: The DeleteTable() method takes as parameters the table name and the table password. Set the password parameter to an empty String object if a table was created without passwords.

TOCIndex