DataTable.Select() if apostrophes in match-string

  • Thread starter Thread starter John Grandy
  • Start date Start date
J

John Grandy

DataTable.Select(<where clause>)

If my <where clause> is something like

WHERE Name LIKE '%Sammy's%'

then the DataTable.Select() will fail (because it sees the apostrophe in
Sammy's as ending the match-string, and doesn't know what to do with the s%'

How to get around this ?
 
Add another apostrophe to the single ones. If you google on
DataTable.Select Apostrophe - there are quite a few examples on how to deal
with it but basically you just need to use another apostrophe ''
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top