You can't convert a Datatable to a reader. A reader only works with an
open database connection and a datatable can't physically connect itself to
a database...the dataadapter actually uses a DataReader and fills the
datatable. If you can't change the existing structure, add another method
that can return a datareader. All in all, they are very very different
objects with different goals and uses. A DataTable can do things a
DataReader can't but a Reader can't do anything a DataTable can't. A
DataReader is faster but that's it. And if you were going to fill a
DataTable anyway, even if a conversino were possible, it would defeat the
only purpose for using a Reader over a DataTable. Since a DataReader is
already used to fill the datatable with the dataadapter, you'd have a
reader, filling a table and then that table would be used to populate a
reader...this would be very inefficient .
With that said, many things can be converted from one to another even though
it's inefficient, but that conversion is impossible. If you have some
other reason, you may want to serialize your dataset to XML using
DataSet.WriteXML("PathName:\FileName.xml") then use an XML Reader to read
the file, but even this is painfully inefficient unless you have a
compelling reason to do so.
HTH,
Bill