Product Documentation

c-treeDB API for C# - Developers Guide

Previous Topic

Next Topic

Class Level API (c-treeDB C++ API)

The c-treeDB C++ API is made up of roughly a dozen classes. A few of the commonly used classes are CTSession, CTDatabase, CTTable, CTRecord, CTIndex and CTSegment. This API is the functional equivalent to its Function Level counterpart. Once a class has been instantiated, typing the name of the instance followed by a ‘.’ (period) will invoke IntelliSense® and a drop-down of all the properties and methods will be presented.

Create Example

pSession = new CTSession(SESSION_TYPE.SESSION_CTDB); pSession.Logon(uid,pwd,svn);

pSession.CreateDatabase("dbName","dbPath");

Open Example

pTable = new CTTable(pDatabase);

pTable.AddField("fldName", ...);

pTable.Create("tblName", CREATE_MODE.CREATE_TRNLOG);

pTable.Open("tblName",OPEN_MODE.OPEN_NORMAL);

Add Example

pRecord = new CTRecord(pTable);

pRecord.Clear();

pRecord.SetFieldValue(0,1000);

pRecord.SetFieldAsString(1,"John Smith");

pRecord.Write();

TOCIndex