Hi Miha
I have written a collection class that returns data from a database table.
I would like to add a number of methods to the class that will also return
the data in a variety of usefull formats as the data will be used in a
variety of ways by different applications.
Some of the methods I have so far are:
SelectAllAsDataSet
SelectAllAsDataTable
SelectAllAsDataView
SelectAllAsXML
I would like to also be able to SelectAllAsDataReader. As all the above
methods use the DataSet object, I create the DataSet in the constructor. I
was hoping to derive the DataReader from the existing DataSet rather than
populating both objects as the table could potentially be quite large.
Since looking more into it, i am not sure i can return a DataReader object
from my class as the DataReader requires a permanent connection to the DB
for the life of the object.
If you have any ideas on this I would be gratefull.
Regards
Dave.
Miha Markic said:
Hi Dave,
Huh?
DataReader is just a sort of forward only readonly cursor.
Why would you need a DataReader from DataSet?
--
Miha Markic [MVP C#] - RightHand .NET consulting & software development
miha at rthand com
www.rthand.com
Is it possible to get a DataReader object from a DataSet/DataTable ? If
so
would it
be disconnected ? in other words could I return a populated DataReader
object from a class that contains a DataSet ?