Add fixed field in a DataReader

L

Luigi

Hi all,
having a DataReader populater with an Excel file, how can add a column with
a fixed value to it?

For example, having DbDataReader dr = cmd.ExecuteReader()

I need to add another column to it.

Thanks a lot.

Luigi
 
G

Gregory A. Beamer

Hi all,
having a DataReader populater with an Excel file, how can add a column
with a fixed value to it?

For example, having DbDataReader dr = cmd.ExecuteReader()

I need to add another column to it.

How do you add food coloring to water coming out of a firehose?

Answer: You don't.

A DataReader is a firehose cursor, so much like trying to add food
coloring to water during a fire, you can't add to it.

In short: You cannot add a column to the cursor. You can, however, add
information as you pull records from the cursor.

With a DataSet, you have more options, as you can add a column.

Do you want to know how to add data as you pull from the DataReader?

Peace and Grace,


--
Gregory A. Beamer (MVP)

Twitter: @gbworld
Blog: http://gregorybeamer.spaces.live.com

*******************************************
| Think outside the box! |
*******************************************
 
S

sloan

//How do you add food coloring to water coming out of a firehose?//

Good illustration! , I'll add that one to "the bag o' tricks" (for
explaining it to someone).

.......
 
G

Gregory A. Beamer

//How do you add food coloring to water coming out of a firehose?//

Good illustration! , I'll add that one to "the bag o' tricks" (for
explaining it to someone).

Analogies help us picture things. here is another one you might like.

Years ago, I had someone telling me "FrontPage sucks" because I
suggested he was coding and needed a tool like InterDev. My answer is
"hammers suck when you want to screw in a screw".

Peace and Grace,

--
Gregory A. Beamer (MVP)

Twitter: @gbworld
Blog: http://gregorybeamer.spaces.live.com

*******************************************
| Think outside the box! |
*******************************************
 
P

Paul

Now if we can only teach builders that.


Gregory A. Beamer said:
Analogies help us picture things. here is another one you might like.

Years ago, I had someone telling me "FrontPage sucks" because I
suggested he was coding and needed a tool like InterDev. My answer is
"hammers suck when you want to screw in a screw".

Peace and Grace,

--
Gregory A. Beamer (MVP)

Twitter: @gbworld
Blog: http://gregorybeamer.spaces.live.com

*******************************************
| Think outside the box! |
*******************************************
 
G

Gregory A. Beamer

Now if we can only teach builders that.

The educational aspect of change takes years, unless there is an
overwhelming din from the masses. :-0

Peace and Grace,

--
Gregory A. Beamer (MVP)

Twitter: @gbworld
Blog: http://gregorybeamer.spaces.live.com

*******************************************
| Think outside the box! |
*******************************************
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top