CriteriaOperator.Parse(String, out OperandValue[]) Method

Converts the specified string, specifying an expression, to its CriteriaOperator equivalent.

Namespace: DevExpress.Data.Filtering

Assembly: DevExpress.Data.v20.1.dll

Declaration

public static CriteriaOperator Parse(
    string stringCriteria,
    out OperandValue[] criteriaParametersList
)
Public Shared Function Parse(
    stringCriteria As String,
    ByRef criteriaParametersList As OperandValue()
) As CriteriaOperator

Parameters

Name Type Description
stringCriteria String

A String value, that is the expression to convert.

criteriaParametersList OperandValue[]

[out] Receives the values that are substituted into the expression in place of question mark characters. These parameters can be omitted.

Returns

Type Description
CriteriaOperator

A CriteriaOperator equivalent to the expression contained in criteria.

Remarks

This member supports the .NET Framework infrastructure and is not intended to be used directly from your code.


OperandValue[] parameters;
CriteriaOperator filterCriteria = 
    CriteriaOperator.Parse("[Category] = ? AND [Price] < ?", out parameters);
parameters[0].Value = "Saloon";
parameters[1].Value = 100000;
// Returns "[Category] = 'Saloon' AND [Price] < 100000"
string filterString = filterCriteria.ToString();
// ...
parameters[0].Value = "Sport";
parameters[1].Value = 50000;
// Returns "[Category] = 'Sport' AND [Price] < 50000"
filterString = filterCriteria.ToString(); 

To learn more, see Limitations of CriteriaOperator.Parse and Criteria Language Syntax.

NOTE

The code example above uses positional parameters to format a criteria expression with values. For more information on positional parameters, refer to the corresponding section in the Criteria Language Syntax topic.

See Also