It is because of missing '
Apostrophe in Row Filter'
When you filter a DataView by setting its
RowFilter
property to a string watch out for apostrophes or you’ll get an exception. What you need to do is double each apostrophe, e.g. this works:
dv.RowFilter = "CompanyName = 'Margie''s Travel'"
Correct your RowFilter expression and you will be fine.