Datareader vs Tableadaptor question

S

Steve

Hi, I currently display all the data on a website using tableadaptors
and objectdatasources.

Would it be significantly faster if I was to display the data by
writing the code for a datareader and connecting to the database
directly and populating my tables that way?

Or is the tableadaptor using a datareader anyway for simple select
statements?

This all comes about as I have read a few articles regarding the
benefits of datareader over datasets, and I am a bit confused if the
tableadaptor/objectdatasource method I am using is using datareaders or
datasets?

I have a read quite a few articles but none the wiser as yet.

Thank you,

Steve.
 
C

Cowboy \(Gregory A. Beamer\)

This is another one of those "will everything go faster" type conversations.
Underneath the hood, data access ultimately comes down to a firehose cursor.
In ADO.NET, this is a DataReader. So, if you only want speed, go for it and
switch everything to DataReaders. The problem is software development is
more than pure speed.

As an analogy, consider the cars that drive on the Bonneville flats. They
are designed to go over 300 MPH. Pur performance. But, you could never use
one of these rocket giants in rush hour traffic, as they are tuned for speed
.... period.

Whenever one looks at pure performance, they end up losing other elements.

Now, if pure speed is your ultimate objective, here is my suggestion. Can
the DataReader idea and create a C native DLL that pulls data as quickly as
possible. Attach to that DLL using native calls and blast the data to your
page. It will not be flexible. It will be hard to maintain. But, damn, it
will be fast. :)

The point? Table adapters are more flexible than firehose cursors. While
they do not perform as well, they are pretty darned fast. And, they are
fairly easy to maintain. If you have a performance problem, you might need
to get rid of the TableAdapter, but make sure it is a performance problem
before you throw everything away.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,999
Messages
2,570,243
Members
46,835
Latest member
lila30

Latest Threads

Top