Appendix B. Expression Syntax

The following is a description from the .NET documentation of the column expression syntax. This syntax is used not only in column expressions, but in filter expressions in DataViews.

When creating an expression, use the ColumnName property to refer to columns. For example, if the ColumnName for one column is “UnitPrice,” and another “Quantity,” the expression would be:

"UnitPrice * Quantity"

When creating an expression for a filter, enclose strings with single quotes:

"LastName = 'Jones'"

The following characters are special characters and must be escaped, as explained below, if they are to be used in a column name:

\n (newline)

\t (tab)

\r (carriage return)

~

(

)

#

\

/

=

>

<

+

*

%

&

|

^

'

[

]

If a column ...

Get Essential ADO.NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.