D
dwok
Hi All,
I have read through some of the posts that compare DataSets and
DataReaders but I did not come across an answer that addresses the
pros/con between using a DataSet or Multiple Connections to the
database for use with DataReaders.
Basically I have a DaraReader that contains records. I will call this
DR1 (DataReader 1). For each row in DR1 I need to query the database
for another set of records. Because the DataReader maintains the
connection to the Database, I would need to open another connection to
the database to handle this second query. What I am wondering is if it
would be better to hold the records currently in DR1 in a DataSet
rather than a DataReader. I would not have to worry about opening
multiple connections as the DataSet is disconnected. However, I know
that there is extra overhead in using a DataSet as opposed to a
DataReader. Since I would really not be using all the advanced features
of the DataSet is it a waste to use it as I described in this scenario?
Would it be better to use DataReaders and open a second connection?
Thanks for any feedback!
- dwok
I have read through some of the posts that compare DataSets and
DataReaders but I did not come across an answer that addresses the
pros/con between using a DataSet or Multiple Connections to the
database for use with DataReaders.
Basically I have a DaraReader that contains records. I will call this
DR1 (DataReader 1). For each row in DR1 I need to query the database
for another set of records. Because the DataReader maintains the
connection to the Database, I would need to open another connection to
the database to handle this second query. What I am wondering is if it
would be better to hold the records currently in DR1 in a DataSet
rather than a DataReader. I would not have to worry about opening
multiple connections as the DataSet is disconnected. However, I know
that there is extra overhead in using a DataSet as opposed to a
DataReader. Since I would really not be using all the advanced features
of the DataSet is it a waste to use it as I described in this scenario?
Would it be better to use DataReaders and open a second connection?
Thanks for any feedback!
- dwok