The requested page is not available for the requested platform. You are viewing the content for Default platform.

CriteriaOperator.ToCStyleString(CriteriaOperator, out OperandValue[]) Method

Converts the specified expression into its equivalent string in C# style.

Namespace: DevExpress.Data.Filtering

Assembly: DevExpress.Core.v19.1.dll

Declaration

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

Parameters

Name Type Description
criteria CriteriaOperator

A CriteriaOperator object that represents the expression to convert.

criteriaParametersList OperandValue[]

Receives the values that are marked by a question mark character in the result string.

Returns

Type Description
String

A string representation of the specified expression.

Remarks

This example demonstrate how to use the ToCStyleString method:

OperandValue[] parameters;
CriteriaOperator filterCriteria = 
    CriteriaOperator.Parse("[Category] = ? AND [Price] < ?", out parameters);

parameters[0].Value = "Saloon";
parameters[1].Value = 100000;

// Returns "[Category] == ? && [Price] < ?"
string filterString = CriteriaOperator.ToCStyleString(filterCriteria, out parameters);

To convert the string representation of an expression to its CriteriaOperator equivalent, use the CriteriaOperator.Parse method.

Note

The ToCStyleString method returns a string representation of the criteria which can be displayed in UI or saved in application log. However, this string is actually not SQL and cannot be considered as such.

See Also