Peter,
Every control in windowsforms is only showing data that is in memory.
A datareader reads one row of data every time, to show that data with a
datagridview is a little bit out of sense.
Don't compare a windowsform with a webpage. A webpage does not hold data,
the page holds itself data, although that is always based on the behaviour
of the browsers and inside the browser data.
You can use a datareader, but only if you first set the data from your
resultset in a collection The collectionBase is a very easy one for that to
use (not the one from the microsoft visualbasic namespace). However a
datatable is nothing more than a very advanced collection class. Adonet uses
the datareader internal in the dataadapter.fill, however has build in all
kind of extra possibilities.
The advantage of using a datareader? That is easier to use when you build by
hand your own strongly typed collection classes where the data comes from
many joined tables. I do that , but for sure not for situations were an
update from the data is needed.
Cor
"Peter" <Pe***@discussions.microsoft.comschreef in bericht
news:BB**********************************@microsof t.com...
I'm trying to add a datagridview control to a Windows Form to display
read-only information in visual basic 2005. My understanding is that
datareader will be faster for this purpose. I have the following
questions:
1. Can DataReader be bound DIRECTLY to DataGridView?
2. If DataReader cannot be bound directly to DataGridView, how can I load
a
DataReader into a DataTable and bind the DataTable to DataGridView? Can
the
DataTable be a standalone one without DataSet?
3. Is there other standard control that I should use instead of
DataGridView? I see there is something called ListView.