Product Documentation

c-treeDB API for C# - Developers Guide

Previous Topic

Next Topic

Database Path

The database path, by default, is the server directory for client/server applications, or the application directory for non-server applications. To set a different database path, when the database is being created, just insert the appropriate path as the second parameter of CTSession.CreateDatabase(). With this information stored in the Session dictionary, the user doesn't need to know where it is located, since it will be automatically retrieved given the database name.

Once the database is successfully connected to a session, obtain the database path with CTDatabase.GetPath().

// display database properties

void DisplayDatabaseProperties(CTDatabase ADatabase)

{

Console.Write("Database: {0}\n", ADatabase.GetName());

Console.Write("Path: {0}\n", ADatabase.GetPath());

Console.Write("Number of tables: {0}\n", ADatabase.GetTableCount());

}

TOCIndex