Binding SqlDataReader to webcomponents

  • Thread starter Thread starter me
  • Start date Start date
M

me

Why is SqlDataReader not present in visual studios Toolbox->Data where
I find components like DataSet? Most examples in books and in vs.net
are based on datasets but using disconnected tables seems a bit
heavyweight for most purposes. I there some particular reason to stay
away from sqldatareader??
I have managed to bind components using sqldatareader but digging up
the
information was quite hard.
 
There is no particular reason to stay away from SqlDataReader. IMHO, I
always use SqlDataReader if I have controls that cause autopostback because
using DataSet causes my ViewState to become extremely large. If you are
simply querying a database and spitting the results straight into a control
without doing any processing, then I would recommend SqlDataReader. If you
want to manipulate the data post-query (sort, filter, etc.), then DataSet
would be the way to go.

HTH,
Mark Jen [MSFT]
 
Back
Top