Data Source Wizard - Configure the Select Statement

The Configure the Select Statement screen determines how the data will be retrieved from the selected database.

In K2 the SmartObjects and their Properties are mapped to tables, while the SmartObject Methods are mapped to stored procedures.

Feature What it is
Specify a custom SQL statement or stored procedure Retrieves data from the selected database by allowing the user to write a SQL statement or select a stored procedure
Specify columns from a table or view The SmartObject properties can be selected and configured
  1. Specify a custom SQL statement or stored procedure is recommended when creating a Capture view.
  2. Specify columns from a table or view is recommended when creating a List view or complex joins between SmartObjects.

Specify columns from a table or view

Selecting a SmartObject from the Name drop-down list will display all the SmartObject properties in the columns section, allowing the user to select the required properties required in the Data source. These properties can be ordered and filters built around the data.

Feature What it is
Name Select the SmartObject from the drop-down list
Columns Displays the SmartObject properties as columns in a table. Properties are selected by clicking on the related check box
SELECT Statement Displays the SELECT statement that is built by selecting the SmartObject properties in the columns section.
Return only unique rows Only unique rows can be returned at runtime
Buttons
WHERE Enables developers to build filters on the table columns displayed in a GridView or DetailView
ORDER BY Allows columns to be ordered in ascending or descending order
Advanced Adds INSERT, UPDATE, and Delete statements based on the select statement

K2 ADO.NET table concepts consist of the combination of both the SmartObject name and the SmartObject Method name. If a query refers to the specific method that must be used as opposed to the default method then the “table” must be quoted. It is recommended that the square brackets are always used for quoting the identifier.