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

CustomSqlQuery Class

A custom query.

Namespace: DevExpress.DataAccess.Sql

Assembly: DevExpress.DataAccess.v17.2.dll

Declaration

public sealed class CustomSqlQuery :
    SqlQuery

The following members accept/return CustomSqlQuery objects:

Library Related API Members
Cross-Platform Class Library ValidateCustomSqlQueryEventArgs.CustomSqlQuery
Dashboard ValidateDashboardCustomSqlQueryEventArgs.CustomSqlQuery
ValidateDashboardCustomSqlQueryWebEventArgs.CustomSqlQuery

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.

The following code snippets (auto-collected from DevExpress Examples) contain references to the CustomSqlQuery class.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

Inheritance

Object
SqlQuery
CustomSqlQuery

Extension Methods

Show 20 items
See Also