single quote problem in sqlquery

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

HI

I'm using dataadapter to fill the data in the dataset from microsoft access. I have a query for that but the query contains filter condition for which the data itselt contains a single quote.So due to that I get a syntax error.What could be the solution for this

Thanks in advance
 
Use replace comman

Dim strLocalVariable as strin

strLocalVariable = Replace(Me.txtFieldName.Text, "'", "''"

- Vija

----- Kshitij wrote: ----

HI

I'm using dataadapter to fill the data in the dataset from microsoft access. I have a query for that but the query contains filter condition for which the data itselt contains a single quote.So due to that I get a syntax error.What could be the solution for this

Thanks in advance
 
Add one more single quote with already existing single quote. Then it will work

Thanks
Rajagopal.S
 
Back
Top