"David C" <(E-Mail Removed)> wrote in
news:(E-Mail Removed):
> Yes, I am sorry for the confusion. I will need both situations in the
> web project. Sometimes I need to do something at the (App_Code) class
> level and sometimes at the page code-behind due to different
> circumstances. I would guess that using a DataTable would allow me to
> do what I need at either location. Am I correct? Thank you all.
If you want a count attached at all times, you need to move to a
construct that keeps the count. A DataTable works, if you are using
DataSets. You can also choose to use LINQ to SQL, which can defer the
actual execution. Entity Framework is another choice.
The end story is that the DataReader is simply a stream, or to use a
database term, a firehose cursor. It is opened up and you pull items
from the stream much like a queue. Once you have pulled everything, you
can count what you pulled. Until then, the system is unaware of what is
there.
Underneath the hood, a DataSet's DataTable is filled using a DataReader,
which kind of gives you a hint at the relationship.
Peace and Grace,
--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
Twitter: @gbworld
Blog:
http://gregorybeamer.spaces.live.com
*******************************************
| Think outside the box! |
*******************************************