473,387 Members | 1,575 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,387 software developers and data experts.

Edit the contents of a loaded SQL DataReader?

Hi, all! I have a populated Reader that I'm binding to a data grid,
and I'm trying to figure out how I can edit cells BEFORE binding the
reader to the DataGrid. Of the few pieces of sample code I've seen a
DataSet is required, and I really don't want to dump a lot of code
into something that may not need it: a quick bind to a reader dumps
data perfectly with zero hassle! ;-)

Obviously the Reader is (duh) read only, so I was wondering if there
was some other quick way to get where I want to go. Essentially, I
just want a simple text replacement on the contents of a field in the
recordset: for example, replace a "99" with "1999" (just an example,
not a date thing).

Thoughts?? Thanks in advance!
Jack
Nov 18 '05 #1
1 1208
Jack Black <ja********@hotmail.com> typed:
Hi, all! I have a populated Reader that I'm binding to a data grid,
and I'm trying to figure out how I can edit cells BEFORE binding the
reader to the DataGrid. Of the few pieces of sample code I've seen a
DataSet is required, and I really don't want to dump a lot of code
into something that may not need it: a quick bind to a reader dumps
data perfectly with zero hassle! ;-)

Obviously the Reader is (duh) read only, so I was wondering if there
was some other quick way to get where I want to go. Essentially, I
just want a simple text replacement on the contents of a field in the
recordset: for example, replace a "99" with "1999" (just an example,
not a date thing).

Thoughts?? Thanks in advance!
Jack


As you know, DataReader is read-only forward only so you cannot change any
field or record. The solution is to work in the event around the bind to the
datagrid.

You could change this value in the ItemDataBound event of the DataGrid.

--
Davide Vernole
MVP ASP/ASP.NET
Microsoft Certified Solution Developer
Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Steve Remer | last post by:
My application (relevant code snippets below) originally used Session variables in order to maintain state from page to page. After being unable to solve the mystery of why those variables were...
2
by: Vish | last post by:
Hi, I amplanning on having a rea-only and edit states for my form. But it do not want my form and its controls to look different or disabled. I am planning on having a edit button that brings...
2
by: Peter | last post by:
ASP.NET 2003 In the DataGrid how do I select current cell value in the dropdown box when I click on the edit link, currently when I click on the edit link in the DataGrid the dropdown box...
2
by: sacha4 | last post by:
I need to make an edit page using data reader. this is my code.. Sub Page_Load() If Not IsPostBack Then Dim conn As SqlConnection Dim cmdSQL As SqlCommand ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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.