CriteriaOperator.FormatConstantValue(Object) Method
Converts an object to a string that can be used in criteria expressions.
Namespace: DevExpress.Data.Filtering
Assembly: DevExpress.Data.v24.2.dll
NuGet Package: DevExpress.Data
#Declaration
#Parameters
Name | Type | Description |
---|---|---|
value | Object | An object to convert. |
#Returns
Type | Description |
---|---|
String | A string that can be used in criteria expressions. |
#Remarks
Use the FormatPropertyName static method to format constant values used in criteria expressions:
var dateTimeString = CriteriaOperator.FormatConstantValue(new DateTime(2022, 2, 1));
// "#2022-02-01#"
var singleString = CriteriaOperator.FormatConstantValue(((Single)Math.Round(Math.PI, 2)));
// "3.14f"
var constString = CriteriaOperator.FormatConstantValue("foo'tab");
// "'foo''tab'"
Important
Use the Format