Using apostrophe in DataTable.Select()

G

Guest

Hi,
I'm using the dataTable.Select() method in my code.
This is my code:
dft.Tables[0].Select("fieldName='" + @fieldName + "'") ;

This works fine until there is an apostrophe in the
fieldName variable - then i get error message:
"Syntax error: Missing operand after ...".

How can i use queries with apostrophe inside?

Thanks.
 

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

Top