Solved

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

Posted on 2009-05-04
2
302 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 33

Accepted Solution

by:
Todd Gerbert earned 500 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

752 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