Product Documentation

c-treeDB API for C# - Developers Guide

Previous Topic

Next Topic

Sharing the Same Context

A record object may be reset to its initial state (that is, to the same state it had just after being created). The record reset function will perform the following actions on a record handle:

  • The context associated with the record is released
  • Record sets are turned off
  • Memory allocated for the record buffer is released
  • Record properties are re-initialized.

// reset a record

try

{

ARecord.Reset();

}

catch (CTException err)

{

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

}

All records associated with a table can be reset in one operation by calling CTTable.ResetAll() method.

// reset all records

try

{

ATable.ResetAll();

}

catch (CTException err)

{

Console.Write("Reset all records failed with error {0}\n", err.GetErrorCode());

}

When a table is closed, all records associated with that table are automatically reset by the CTTable.Close() method.

TOCIndex