none
RowFilter in Dataset RRS feed

  • Question

  • Hi,

    I am getting the below error when i use the single quote character in the RowFilter expression.

    Error - The expression contains an invalid string constant: '

    My Search string character can contain the singlequote and double quote. Bcz i need the single quote and doublequote in my search expression as string can have these characters.

    Please help.

    Thanks
    Ashok

    Monday, April 20, 2009 9:53 AM

Answers

  • To escape single quotes in your filter condition you need to double each single quote and then it will work. You could use Replace method of String class to replace any single quotes inside of your filter string with the doubled single quote and then assign that string to RowFilter property.
    Val Mazur (MVP) http://www.xporttools.net
    Tuesday, April 21, 2009 10:21 AM
    Moderator