KernelCAD Documentation

DInsight Home
Skip Navigation Links.
Start page
Quick Start
Installation
Overview of the software
What is new
Collapse KernelCAD ModelsKernelCAD Models
Collapse KernelCAD ComponentsKernelCAD Components
KernelCAD Control
KernelCAD .NET Control
Methods and Properties
Menu
Model Explorer
Birds Eye View
Programming
Direct User Access
Direct Operations
Interface Queries
Printing Support
Data Types
Modes of KernelCAD Control
DIObjectGenerator class
Properties
FlatObjectArray Poperty
Context
64 bit development
Dual Mode
Initialisation Context
Overlay Editor
Memory Management
Input validation
Collapse Advanced functionalityAdvanced functionality
Collapse InterfacesInterfaces
Alphabetical list
I3DGrid
I3DBugger
I3Dpt
IAxiBase
IAxis
IBoolSection
IBoolSectionEx
IBoundary
IColor
IConstraint
IData
IDiffSurface_KC
IDIFont
IDraw
IDrawUtil
IDraw2
IElem
IElement
IKCLine
ILightSource
ILocation
ILocationEx
IMaterial
IMetrics
IMetrics2
IModel
IModel2
IModelEx
IPatch
IKCPathCollisionDetector
IProfiles
IPropertyArray
IPropertyArray2
IStdShape
IStrip
ISurface
IText
ITexture
ITransform
IUnknown
Collapse Open Cascade TechnologyOpen Cascade Technology
Collapse DataData
Collapse MovementMovement
Collapse FramesFrames
Collapse Oriented ObjectsOriented Objects
Collapse SectionsSections
Collapse GeneralGeneral
Collapse Topological InterfacesTopological Interfaces
Collapse Viewing InterfacesViewing Interfaces
Collapse Lines And CurvesLines And Curves
Collapse Symmetry InterfacesSymmetry Interfaces
Collapse Clipping plane interfacesClipping plane interfaces
Collapse AlgorithmsAlgorithms
Collapse 2D Geometry2D Geometry
Collapse Programming Samples and TutorialsProgramming Samples and Tutorials
Collapse OverviewOverview
Collapse DeploymentDeployment
Collapse .NET Samples.NET Samples
Collapse C++ SamplesC++ Samples
Collapse Visual Basic SamplesVisual Basic Samples
Collapse Delphi SamplesDelphi Samples
Collapse 3D Debugger3D Debugger
Collapse DeploymentDeployment
Licensing
Model Viewer
Open C++ Source
Technical Support
Skip Navigation LinksHome Page > KernelCAD Components > Interfaces > Data > User Data > IDataTable
IDataTable Inteface

IDataTable Interface

GetFieldCount
DeleteField
InsertField
SetFieldSize
GetFieldSize
SetFieldDescription

IDataTable allows modification of field structure in data table of the model. To read data from the table use IDIData. To enter data in the table use IDataMods interface.  IDataTable can be queried from IDataSource.

Query path: Control >GetModel >IModel > IDataSource > IDataTable

See also User Data Sample, IDataSource, IDataMods, IRecordSet


HRESULT GetFieldCount(int* count)

Parameters

count - [out, retval] The returned current count of fields in the table

Return Values

S_OK in case of success.

DISP_E_PARAMNOTOPTIONAL - if count is a NULL reference.

Remarks:

Returns the current count of fields in the table.


HRESULT DeleteField(int field)

Parameters

field - [in] 0-based index of the field to be removed from the table. Must be equal to or less than the current field count.

DISP_E_BADINDEX - if field is equal to or greater than the current field count.

Return Values

S_OK in case of success.

Remarks:

Deletes the field from the table. All associated data will be lost.


HRESULT InsertField(int field, EDataType type)

Parameters

field - [in] 0-based index of the field to be inserted in the table. Must be equal to or less than the current field count.

type - [in] member of member of EDataType enumeration describing the type of the field.

Return Values

S_OK in case of success.

DISP_E_BADINDEX - if field is equal to or greater than the current field count.

Remarks:

Inserts new field of the required type into the table. For existent records the new field is populated with default values of the type. Existent fields preserve its data.


HRESULT SetFieldSize(int field, int size)

Parameters

field - [in] 0-based index of the field to be inserted in the table. Must be equal to or less than the current field count.

size - [in] New field size in bytes

Return Values

S_OK in case of success.

DISP_E_BADINDEX - if field is equal to or greater than the current field count.

DISP_E_PARAMNOTOPTIONAL - if  field is not a string field.

Remarks:

This method is used to set size of a a string field, which is the only type of field with variable length. Default size of string field is 40 bytes. If  field is not a string field. error DISP_E_PARAMNOTOPTIONAL is returned.


HRESULT GetFieldSize(int field, int* size)

Parameters

field - [in] 0-based index of the field to be inserted in the table. Must be equal to or less than the current field count.

size - [out, retval] The returned size of the field

Return Values

S_OK in case of success.

DISP_E_BADINDEX - if field is equal to or greater than the current field count.

DISP_E_PARAMNOTOPTIONAL - if field is not a string field.

Remarks:

This method is used to obtain size of a a string field, which is the only type of field with variable length. Default size of string field is 40 bytes. If  field is not a string field. error DISP_E_PARAMNOTOPTIONAL is returned.


HRESULT SetFieldDescription(int field, char* description)

Parameters

field - [in] 0-based index of the field to be inserted in the table. Must be equal to or less than the current field count.

description - [in] Description of the field. There is no limit on the length of the string.

Return Values

DISP_E_BADINDEX - if field is equal to or greater than the current field count.

S_OK in case of success.

Remarks:

Stores description of the field in the table. There is no limit on the length of the string.