Does a Data Adapter Open() the connection automatically?

  • Thread starter Thread starter Chris Y
  • Start date Start date
The Fill opens and closes the connection (as long as it's closed
beforehand).


--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
 
Ah, not really. The DataReader is the low-level data stream used by the Fill
method to fetch the rowset. It is RO/FO and can't be used to "scroll"
through the rowset returned by the query. The Fill populates one or more
DataTable instances within a DataSet--one for each rowset returned by the
query. All you can do with a DataReader in an ASP application is use it to
populate a bound control (like a grid or textbox) or access the individual
rows and columns one-by-one.

hth

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
 
Sahil, thanks. Your d) raises a new question in my mind. Is there a choice
between connected and disconnected for a ASP.NET situation?
 
Chris,

A first measure-point to decide.

if you have only to show data 'the datareader
if you have to update that data as well 'the dataset/dataadapter/session

I hope this gives an idea

Cor
 
Back
Top