PC Review


Reply
Thread Tools Rate Thread

Add fixed field in a DataReader

 
 
Luigi
Guest
Posts: n/a
 
      3rd Dec 2009
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
 
Reply With Quote
 
 
 
 
Gregory A. Beamer
Guest
Posts: n/a
 
      3rd Dec 2009
=?Utf-8?B?THVpZ2k=?= <(E-Mail Removed)> wrote in
news:925F1F79-1BF4-41F4-9463-(E-Mail Removed):

> 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! |
*******************************************
 
Reply With Quote
 
sloan
Guest
Posts: n/a
 
      9th Dec 2009
//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).

.......


"Gregory A. Beamer" <(E-Mail Removed)> wrote in message
news:Xns9CD691F852098gbworld@207.46.248.16...
> =?Utf-8?B?THVpZ2k=?= <(E-Mail Removed)> wrote in
> news:925F1F79-1BF4-41F4-9463-(E-Mail Removed):
>
>> 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! |
> *******************************************



 
Reply With Quote
 
Gregory A. Beamer
Guest
Posts: n/a
 
      9th Dec 2009
"sloan" <(E-Mail Removed)> wrote in news:OOH8bzNeKHA.4112
@TK2MSFTNGP06.phx.gbl:

> //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! |
*******************************************
 
Reply With Quote
 
Paul
Guest
Posts: n/a
 
      11th Dec 2009
Now if we can only teach builders that.


"Gregory A. Beamer" <(E-Mail Removed)> wrote in message
news:Xns9CDC71CF1B68Bgbworld@207.46.248.16...
> "sloan" <(E-Mail Removed)> wrote in news:OOH8bzNeKHA.4112
> @TK2MSFTNGP06.phx.gbl:
>
>> //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! |
> *******************************************



 
Reply With Quote
 
Gregory A. Beamer
Guest
Posts: n/a
 
      11th Dec 2009
"Paul" <(E-Mail Removed)> wrote in news:OfTwjFleKHA.4952
@TK2MSFTNGP06.phx.gbl:

> 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! |
*******************************************
 
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
Making a variable number field into a fixed digit field AJCB Microsoft Access 12 10th Sep 2009 02:47 AM
DataReader Field Names Paul Ilacqua Microsoft ADO .NET 1 11th Aug 2005 11:37 PM
oracle number field and datareader =?Utf-8?B?TWlrZQ==?= Microsoft Dot NET 2 11th Aug 2005 02:09 PM
How to display a field value from a DataReader? Shapper Microsoft ASP .NET 1 22nd Apr 2005 07:27 PM
Question: Accessing a field in datareader Miha Markic Microsoft ADO .NET 3 10th Jan 2004 12:47 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:44 PM.