Solved

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

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Data Saving(2) 2 41
Sum Column in GridView 3 44
DateTimepicker 4 33
Page navigation in windows phone 8.1 application not working. 5 19
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…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

867 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

16 Experts available now in Live!

Get 1:1 Help Now