Product Documentation

c-treeDB API for C# - Developers Guide

Previous Topic

Next Topic

Creating a Database Object

A valid database object is required to perform any database operation. You need to pass a valid CTSession object to the CTDatabase() constructor.


// create a CTDatabase object

CTDatabase ADatabase = new CTDatabase(ASession);

try

{

// connect to database "MyDatabase"

ADatabase.Connect("MyDatabase");

}

catch (CTException err)

{

Console.Write("Database connect failed with error {0}\n", err.GetErrorCode);

}

TOCIndex