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

TableQuery.FilterString Property

Gets or sets the criteria used to filter data returned by the current TableQuery.

Namespace: DevExpress.DataAccess.Sql

Assembly: DevExpress.DataAccess.v18.2.dll

Declaration

[DefaultValue(null)]
[LocalizableCategory(DataAccessStringId.QueryPropertyGridTableSelectionCategoryName)]
public string FilterString { get; set; }

Property Value

Type Default Description
String *null*

A String value that specifies the criteria used to filter data returned by the current TableQuery.

Remarks

The FilterString property allows you to filter the result set returned by TableQuery by specifying the required filter criteria. Note that if you want to filter a TableQuery by specified column values, you should 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.


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

To pass the existing query parameter (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.Parameters.Add(queryParam1);
query.FilterString = "[SalesPerson.CategoryName] = ?Parameter1";

To learn more about building filter criteria, see Creating Criteria.

See Also