SelectQuery.FilterString Property

Specifies the criteria used to filter data returned by the current SelectQuery.

Namespace: DevExpress.DataAccess.Sql

Assembly: DevExpress.DataAccess.v20.2.dll


public string FilterString { get; set; }

Property Value

Type Default Description


A String value, specifying the filter criteria.


The FilterString property allows you to filter the result set returned by SelectQuery by specifying the required filter criteria. To filter a SelectQuery by specified column values, precede a column name with a corresponding table name. For instance, you can filter the SalesPerson table by the Beverages category in the following way.

SelectQuery query = new SelectQuery("Query 1");
query.AddTable("SalesPerson").SelectColumns("CategoryName", "Extended Price");
query.FilterString = "[SalesPerson].[CategoryName] = 'Beverages'";

To pass a QueryParameter (which can be accessed using the SqlQuery.Parameters property) to the filter string, precede the parameter name with the ? sign.

QueryParameter queryParam1 = new QueryParameter("Parameter1", typeof(string), "Beverages");
query.FilterString = "[SalesPerson].[CategoryName] = ?Parameter1";

If a table or column name includes dots, enclose the table/column name in square brackets.

For example, if you have a table with the "" name and a column with the "" name, refer to the column in the following manner: [[\].[\]]. If you have only the column name with a dot, refer to it as follows: [tablename.[\]]. As you can see, you should use \ to avoid closing the expression beforehand.

To learn more about building filter criteria, see Simplified Criteria Syntax.

See Also