I'm with you David. For typical queries, the difference in performance is
negligible. Don't throw up the "5000 rows" argument. If you're fetching 5000
rows, you're probably not thinking about performance anyway--you're thinking
about bulk transfers. I think (and lots of development managers agree) that
DataAdapter.Fill is cheaper. Since I don't have to worry about reading each
row and moving each column of data, it IS easier to code Fill. I would add
"Automatic Connection management", "DataViews" and several more items to
your list.
--
____________________________________
Bill Vaughn
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.
__________________________________
"David Browne" <davidbaxterbrowne no potted
(E-Mail Removed)> wrote in
message news:(E-Mail Removed)...
> "Tushar Karsan" <(E-Mail Removed)> wrote in message
> news:OOxaW%(E-Mail Removed)...
> > My application uses a DataReader to get information from a database. For
> > testing purposes, I would like to use hardcoded dummy values instead of
> > reading anything from the database. As it is possible to store multiple
> > tables in a DataSet, is there a way to serialize the DataSet then
> > deserialize the stream and create a DataReader from it? Can a DataReader
> be
> > created any other way using hardcoded values?
>
> No. This is one of the many reasons DataTables are more flexible than
> DataReaders.
>
> If your application code consumed DataTables instead of DataReaders, this
> would be trivially easy.
>
> So consider returning DataTables instead of DataReaders to your
application.
>
> Top 10 reasons to use DataTables instead of DataReaders:
>
> 10. Sorting
> 9. Rows.Count
> 8. Random Access
> 7. Using DataTables returns the connections to the pool sooner.
> 6. Serializable
> 5. DataTables can easily be switched from live data to canned data or
> load-time data
> 4. Strong Typing Available
> 3. DataTables can be saved in Session state or a global variable and
reused
> and shared
> 2. DataTables don't block the connection (you can use the connection
while
> iterating the rows)
> 1. DataTables are idiot-proof (needn't be closed)
>
> David
>
>
>
>