Hi Kumar, I believe this is your first post, so welcome to the Group ! Hope you have a great time here. Please make sure to read the rules of the Group (Home page).
This is only too common an error ! Ad-hoc SQL queries like this one are only too susceptible to this kind of error. In this case, your query ends abruptly when it encounters another single quote. It also indicates that your code is vulnerable to SQL injection attack. (For a comical illustration of SQL Injection, see http://xkcd.com/327/ ) I would suggest: 1. Using parameters instead. They have built in error checks and content escaping capability. OR 2. Clean your input manually. Escape all single quotes with another quote before it...'CICI''S%' On Sep 13, 10:29 pm, "Kumar app" <[EMAIL PROTECTED]> wrote: > How do I search for a row which has a single quote in the data > For example: > The query in ASP would be like > Select * from table where name like 'CICI%' > > It is throwing an error when the data given in single quotes is like > Select * from table where name like 'CICI'S%' > > How can the query be modified? > > -- > Kumar APP > Blog:http://sparsham.com > Twitter:http://twitter.com/thevolts > Linkedin:http://www.linkedin.com/in/kumarapp > Mobile: +91 9243089554 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://cm.megasolutions.net/forums/default.aspx -~----------~----~----~----~------~----~------~--~---
