Using apostrophe in DataTable.Select()

  • Thread starter Thread starter Guest
  • Start date Start date
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.
 
Back
Top