Friday, September 4, 2009

Syntax error: Missing operand after 's' operator.

Don't bother trying to filter a DataView by setting the RowFilter property to a string with a single quote. Make sure you escape the quotes first:

dv.RowFilter = "Something = 'O'Malley'";

becomes...

dv.RowFilter = "Something = 'O''Malley'";

No comments:

Post a Comment