469,618 Members | 2,578 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,618 developers. It's quick & easy.

Datagrid on load; replace all double single quote to single quote to display to user

Hi,

I've saved data into the db by doing a replace() on single quote.

Right now on data display on a datagrid, it shows double single quote.

How do I make changes during run time of datagrid so that the double single quote will be replaced as single quote?

Pls advise.

Thanks
Apr 12 '07 #1
3 2564
Your best bet, especially to prevent SQL injection attacks, instead, would be to use Parameterized Queries.
Here's a 2 part tutorial on that subject:
http://aspnet101.com/aspnet101/tutorials.aspx?id=1

David Wier
MVP/ASPInsider
http://aspnet101.com
http://aspexpress.com
"Eric Layman" <namyalcire[at no spam]gmail.comwrote in message news:11*************@sp6iad.superfeed.net...
Hi,

I've saved data into the db by doing a replace() on single quote.

Right now on data display on a datagrid, it shows double single quote.

How do I make changes during run time of datagrid so that the double single quote will be replaced as single quote?

Pls advise.

Thanks
Apr 12 '07 #2
On Apr 12, 1:10 pm, "Eric Layman" <namyalcire[at no spam]gmail.com>
wrote:
Hi,

I've saved data into the db by doing a replace() on single quote.

Right now on data display on a datagrid, it shows double single quote.

How do I make changes during run time of datagrid so that the double single quote will be replaced as single quote?
Are you saying the datagrid is converting a single quote from the
database two 2 single quotes?

Apr 12 '07 #3
On 12 Apr 2007 12:59:49 -0700, Larry Bud wrote:
On Apr 12, 1:10 pm, "Eric Layman" <namyalcire[at no spam]gmail.com>
wrote:
>Hi,

I've saved data into the db by doing a replace() on single quote.

Right now on data display on a datagrid, it shows double single quote.

How do I make changes during run time of datagrid so that the double single quote will be replaced as single quote?

Are you saying the datagrid is converting a single quote from the
database two 2 single quotes?
If the database stored a double quote then your code to save is the
culprit. Are you by any chance using parameterize queries for the insert?
If you are then there is no need to do the replace as parameters are smart
enough to handle single quotes
--
Bits.Bytes
http://bytes.thinkersroom.com
Apr 14 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by John Richardson | last post: by
reply views Thread by Daniel Armstrong | last post: by
4 posts views Thread by Neo Geshel | last post: by
2 posts views Thread by Tim::.. | last post: by
6 posts views Thread by Ron L | last post: by
2 posts views Thread by =?Utf-8?B?SnVsaWEgQg==?= | last post: by
reply views Thread by devrayhaan | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.