Skip to main content
A newer version of this page is available. .

CustomSqlQuery Class

A custom query.

Namespace: DevExpress.DataAccess.Sql

Assembly: DevExpress.DataAccess.v19.2.dll

Declaration

public sealed class CustomSqlQuery :
    SqlQuery

Remarks

The code sample below demonstrates how to create a CustomSqlQuery that selects all the elements of all the rows of a table.

using DevExpress.DataAccess;
using DevExpress.DataAccess.ConnectionParameters;
using DevExpress.DataAccess.Sql;
// ...

private SqlDataSource BindToData() {
    // Create a data source with the required connection parameters.   
    Access97ConnectionParameters connectionParameters =
    new Access97ConnectionParameters("../../Data/nwind.mdb", "", "");
    SqlDataSource ds = new SqlDataSource(connectionParameters);

    // Create an SQL query to access the Products table.
    CustomSqlQuery query = new CustomSqlQuery();
    query.Name = "customQuery1";
    query.Sql = "SELECT * FROM Products";

    ds.Queries.Add(query);
    return ds;
}

Note

Any parameters passed to a CustomSqlQuery should not be multi-value parameters.

Inheritance

Object
SqlQuery
CustomSqlQuery

Extension Methods

Show 20 items
See Also