reuse SQLDataReader in multiple dropdownlists?

  • Thread starter Thread starter Craig Buchanan
  • Start date Start date
C

Craig Buchanan

I would like to reuse a SQLDataReader that is populated with information as
the datasource for multiple dropdownlists. Unfortunately, the first DDL
closes the SDR and my code fails on the second DDR. Is there a way to
copy/clone the SDR? Is there another solution?

Thanks,

Craig Buchanan
 
DataSet. Can bind to as many controls as you wish.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

**********************************************************************
Think Outside the Box!
**********************************************************************
 
Not to mention it's disconnected. DataReaders keep an open connection to the
database so re-using the same DataReader will waste a lot of bandwidth and
server time fetching the rows again and again. The DataSet (or DataTables
for that matter) fetch all the results and then close the connection. Much
more efficient if you are using the data repeatedly and much nicer on the
database.

Hope this helps
Mark Fitzpatrick
Microsoft MVP - FrontPage
 
Back
Top