PC Review


Reply
Thread Tools Rate Thread

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

 
 
Eric Layman
Guest
Posts: n/a
 
      12th Apr 2007
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
 
Reply With Quote
 
 
 
 
ElmoWatson
Guest
Posts: n/a
 
      12th Apr 2007
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.com> wrote in message news:(E-Mail Removed)...
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
 
Reply With Quote
 
Larry Bud
Guest
Posts: n/a
 
      12th Apr 2007
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?



 
Reply With Quote
 
Rad [Visual C# MVP]
Guest
Posts: n/a
 
      14th Apr 2007
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
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
If single-quote and double-quote are in text Bob Barnes Microsoft Access 2 25th Nov 2007 09:56 PM
Using VBA Replace function for single quote galantis Microsoft Excel Programming 8 5th Aug 2005 02:01 PM
quote delimiters double and single David Bird Microsoft Dot NET 2 8th Mar 2005 09:30 PM
Single and Double Quote marks Thomas Kroljic Microsoft Access Form Coding 2 15th Feb 2005 06:16 PM
Single & Double Quote in SQL String =?Utf-8?B?QWxiZXJ0?= Microsoft Access Form Coding 1 11th Nov 2003 01:18 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:04 AM.