CTSession.NextDatabase() will retrieve the name and path of the next database in a session. CTSession.NextDatabase() returns false (false) when no more databases exist for the current session.
// display all databases in a session
CTDBRET DisplayDatabases(CTSession ASession)
{
CTDBRET Retval = CTDBRET_OK;
try
{
StringBuilder dbName = new StringBuilder();
StringBuilder dbPath = new StringBuilder();
if (ASession.FirstDatabase(out dbName, out dbPath))
do
{
Console.Write("Database: {0} Path: {1}\n", dbName.ToString(),
dbPath.ToString());
}
while (ASession.NextDatabase(out dbName, out dbPath);
}
catch (CTException err)
{
Retval = err.GetErrorCode();
}
return Retval;
}