On WebForms you can, you just set the datasource to command.ExecuteReader.
On the desktop there isn't , at least not yet. You'll be able to in ADO.NET
2.0 - not doing you any good now but a very cool feature. The datatable
will have a .Load method which takes a datareader as a parameter and
populates the Datatable from it - I wrote a little about it
http://msmvps.com/williamryan/archive/2004/07/14/10090.aspx here and it's
very cool.
For the time being, you're going to hvae to either bind to a datatable
(which isn't a bad thing even on the web b/c you may need some of the iList
features) or loop through your reader and build a datatable from it - since
adapters use DataReaders behind the scenes w/ Fill, you're not gaining much
and when you consider the maintenance burden - it's probably a raw deal.
HTH,
Bill
--
W.G. Ryan MVP Windows - Embedded
Have an opinion on the effectiveness of Microsoft Embedded newsgroups?
Let Microsoft know!
https://www.windowsembeddedeval.com/community/newsgroups
JM said:
Is there a way to load a DataGrid using an OracleClient.OracleDataReader?
I've seen code where a SqlDataReader is used, but I get an error when trying
to use an OracleDataReader.