ComponentOne FlexPivot for WinForms
DataEngine Overview / Using C1DataEngine / Simple Operations
In This Topic
    Simple Operations
    In This Topic

    After getting hold of the base tables, you can perform a range of operations by formulating queries. Having the easy way to represent columns, we can formulate a query for simple operations as illustrated below.

    Syntax

    Dim query1 As Object = workspace.query("prices", New With { _ 
                Key .Order = od.OrderID, _
                Key .Product = Od.ProductID _
                Key .Price = Op.Mul(od.UnitPrice, od.Quantity), _
            })
    
    dynamic query1 = workspace.query("prices", new
        {
            Order = od.OrderID,
            Product = od.ProductID,
            Price = Op.Mul(od.UnitPrice, od.Quantity)
        });
    

    This is a simple query over a single table without grouping and aggregation. It creates a table (result of any query is a table) having the same number of rows as the base table OrderDetails. It has three columns called Order, Product, and Price. In every row, columns Order and Product contain the same order and Product IDs as in the base OrderDetail row. The Price column is unit price times quantity. Op.Mul is multiplication operation. Other binary operations have similar notation:

    There are also some unary operations. For example, Op.UCase(products.ProductName) converts string to upper case. All operations are listed in the class C1.DataEngine.Op

    To execute a query, use the Execute method as illustrated below.

    Syntax

    query1.Query.Execute()
    
    query1.Query.Execute();