Solved

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

Posted on 2009-05-04
2
262 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 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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

760 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now