Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Datagrid on load; replace all double single quote to single quote to display to user

Reply
Thread Tools

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

 
 
Eric Layman
Guest
Posts: n/a
 
      04-12-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
 
      04-12-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:...
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
 
      04-12-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
 
      04-14-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

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
problem with single-quote and double-quote when using subprocess. Evan Python 3 11-04-2008 12:24 PM
How to handling string contains single quote and double quote vikrant Perl Misc 8 05-17-2007 04:37 PM
Single Quote Versus Double Quote In A href link knee-dragger@hotmail.com HTML 3 06-13-2006 12:42 AM
cannot convert parameter from 'double (double)' to 'double (__cdecl *)(double)' error Sydex C++ 12 02-17-2005 06:30 PM
Double double display display problem problem Tom Accuosti Firefox 3 09-27-2004 10:02 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57