Product Documentation

c-treeDB API for C# - Developers Guide

Previous Topic

Next Topic

Creating a New Session Dictionary

When operating with sessions of type SESSION_TYPE.CTDB_SESSION or SESSION_TYPE.SQL_SESSION, a session dictionary file named ctdbdict.fsd is required before a session logon is performed. The session dictionary file ctdbdict.fsd is located by default either in the server directory (client/server application) or in the application directory (stand-alone application).

There could be situations where the c-treeDB .NET session dictionary file does not exist because it was deleted or this is the very first time the system is being executed. In this case it is necessary to create a session dictionary file before attempting to log on to a session. It is important to note that only one session dictionary file is necessary for the normal operation of c-treeDB .NET. Once created, the session dictionary file can be used for all database and table operations.

The following code fragment shows an example on how to create a new session dictionary file:


CTSession ASession = new CTSession();

try

{

ASession.Create("FAIRCOMS", "ADMIN", "ADMIN");

}

catch (CTException err)

{

Console.WriteLine("Create session failed with error {0}", Err.GetErrorCode());

}

Note: Delphi users should use the equivalent method CreateSession() instead of Create().

In the server name, the full network address may be used (FAIRCOMS@10.0.0.1 or FAIRCOMS@my_machine.com for instance). For non-server applications, the parameter is ignored and may be set to NULL.

A valid user name is required to access the FairCom DB Server. When the FairCom DB server is first installed, only the default user is permitted server access. This user name, ADMIN, is intended for the database administrator. ADMIN is also the default user name for c-treeDB .NET sessions. For non-server applications, the user name may be NULL. For server applications, see the c-tree Server Administrator’s Guide on how to create users and groups.

A valid user password is also required to access the FairCom DB Server. When the server is first installed, the default user ADMIN is associated with the default password, also ADMIN. For non-server applications, the user password may be NULL.

TOCIndex