O'Reilly logo

Essential ADO.NET by Bob Beauchemin

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required