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);
}