ComponentOne FlexPivot for WinForms
DataEngine Overview / Using C1DataEngine / Base Tables
In This Topic
    Base Tables
    In This Topic

    Base tables are simply data imported into DataEngine from external sources using connectors. Base tables act as input data for queries. Since a query or query result is also a table, you can distinguish between the two by the fact that base tables are not produced by queries. Every base table has a name (it must be unique in the workspace) and a collection of columns. When a workspace is initialized in code, some base tables can already exist (their data stored in the workspace's folder in memory-mapped files) and some can be added after workspace initialization.

    A query is based on a table or on multiple tables if it's a join query. We will consider queries based on a single table first. A simple, non-join query is based on a base table or another query. Let us start with a simple case of a query over a base table first. To define query, you need to get hold of a base table first. This can be done using the syntax below.

    Syntax

    Dim workspace As C1.DataEngine.Workspace = C1.Win.FlexPivot.C1FlexPivotPanel.CreateWorkspace()
    Dim od As Object = workspace.table("OrderDetails")
    
    C1.DataEngine.Workspace workspace = C1.Win.FlexPivot.C1FlexPivotPanel.CreateWorkspace();
    dynamic od = workspace.table("OrderDetails");
    

    This is an object representing a base table with the name "OrderDetails". Note that such table must already exist (i.e. must have been created earlier by importing data via a connector). This object is dynamic to make it easy (and type-safe) for you to reference table columns. For example, od.ProductID is the ProductID column, and od.Discount is the Discount column of the OrderDetails table

    Note:
    In earlier versions, users could create Worskpace from the following code snippet:

    Dim workspace As C1.DataEngine.Workspace = New C1.DataEngine.Workspace()
    
    C1.DataEngine.Workspace workspace = new C1.DataEngine.Workspace();
    

    The Workspace class is provided in the DataEngine namespace, so it uses a different license from that of WinForms. Now, we have added licensing at the FlexPivot-level so that the end-users don't have to worry about licensing the DataEngine library separately. You can simply use the WinForms license in the current version and easily create workspace with the new CreateWorkspace() method of C1FlexPivotPanel class of C1.Win.FlexPivot namespace.

    Dim workspace As C1.DataEngine.Workspace = C1.Win.FlexPivot.C1FlexPivotPanel.CreateWorkspace()
    
    C1.DataEngine.Workspace workspace = C1.Win.FlexPivot.C1FlexPivotPanel.CreateWorkspace();