AxpDataGrid

AxpDataGrid.SQL Property

The main SQL SELECT statement for this grid and form. For stored procedures, just type in the Stored Procedure name.

[Visual Basic]
Public Property SQL As String
[C#]
public string SQL {get; set;}

Remarks

AxpDataGrid has 4 SQL properties: SQL, FormSQL, EditSQL and DeleteSQL.

The SQL property must always be set, the rest are optional, unless data editing is enabled.

The SQL property can contain any valid SQL SELECT statement, including joins.
Avoid using ORDER BY as the grid has functionality for ordering the dataset.

Examples:

AxpDataGrid1.SQL = "select * from Products"
AxpDataGrid1.SQL = "select ProductId, ProductName from Products"
            

FormSQL determine what to display in Form View Mode. It defaults to SQL if not set. Setting FormSQL is useful for displaying more details in form mode.

Stored Procedures returning recordsets can be specified.
Just set SQL="the name of the stored procedure".
After setting the stored procedure name, parameters can be set through on property StoredProcCommand.

Example (MS SQL):
AxpDataGrid1.SQL = "spname"
AxpDataGrid1.StoredProcCommand.Parameters.Add("@paramname", "paramvalue")
            

Parameterless Access "stored procedures" returning recordsets are really views and these should be specified as SQL="SELECT * FROM spname"

See Also

AxpDataGrid Class | Axezz.WebControls Namespace