473,386 Members | 1,721 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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 2720
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: John Richardson | last post by:
I've been bothered for some time about my DataGrid not populating my rows very quickly. I have about 10K rows loading into the grid. I create a datatable dt with 2 columns, an ID and a display. ...
0
by: Daniel Armstrong | last post by:
Hello, I have a usercontrol that I have built that has a single generic datagrid. When setting up the inital properties I build the template columns for the datagrid dynamically so it can...
0
by: optimizeit | last post by:
What I am attempting to do is import an Excel Workbook and display the worksheets in a datagrid dynamically. I am very close to getting this to work. I have to this point successfully imported a...
4
by: Neo Geshel | last post by:
Greetings I am using VB in my ASP.NET project that uses an admin web site to populate a database that provides content for a front end web site. I am looking for a way to use replace() to...
2
by: Tim::.. | last post by:
Hi I'm trying to create a little application that shows an image of a user when you mouseover there details in a datagrid. The datagrid is populated from an Active Directory Database and I...
6
by: Ron L | last post by:
I have a dataset whose source is a SQL 2k stored procedure that I am trying to display in a datagrid. This datasource has 4 columns that I am interested in here, a text column and 3 value columns...
10
by: mark | last post by:
I have a simple windows application that has a function to read a csv file and enter the values into an array A as double(,). Also, an instance of form 2 (which has a DataGrid) is created and the...
8
by: Brock | last post by:
I am trying to populate a Crystal Report from data in my DataGrid. The reason for this is that I want the user to be able to change values without updating the database, but still have their report...
2
by: =?Utf-8?B?SnVsaWEgQg==?= | last post by:
Hi all Got a weird problem with pagination on a datagrid in asp.net 1.1. It's populated depending on user selected criteria (it either displays all or 1 record). It works fine in the...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.