Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How to parse a single quotes in a dataset.table.select(stringfilter) method

Posted on 2009-05-04
2
Medium Priority
?
313 Views
Last Modified: 2012-05-06
Hi,

I am looking to parse a string that contains an apostrophe and I need to parse the single quote.

dataset.Addresses.Select("AddressLine1 = '" + St.John's +"'")
need to parse the single quote in St.John's

Any suggestion
0
Comment
Question by:busapps
2 Comments
 
LVL 33

Accepted Solution

by:
Todd Gerbert earned 2000 total points
ID: 24297809
You mean you need to escape it?  

I *think* that's dependant on the underlying database, but assuming you're using MS SQL Server you should be able to use two consecutive single quotes - St. John''s

string criteria = "St. John's";
.Select(AddressLine1 = '" criteria.Replace("'", "''");
0
 
LVL 1

Author Closing Comment

by:busapps
ID: 31577670
That worked Thanks
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
High user turnover can cause old/redundant user data to consume valuable space. UserResourceCleanup was developed to address this by automatically deleting user folders when the user account is deleted.
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

971 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question