Datareader vs Tableadaptor question

Discussion in 'ASP .Net' started by Steve, Dec 12, 2006.

  1. Steve

    Steve Guest

    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.
     
    Steve, Dec 12, 2006
    #1
    1. Advertising

  2. 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.

    --
    Gregory A. Beamer
    MVP; MCP: +I, SE, SD, DBA
    http://gregorybeamer.spaces.live.com

    ********************************************
    Think outside the box!
    ********************************************
    "Steve" <> wrote in message
    news:...
    > 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.
    >
     
    Cowboy \(Gregory A. Beamer\), Dec 12, 2006
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. John Saunders
    Replies:
    1
    Views:
    494
    VB Programmer
    Aug 12, 2003
  2. Ravikanth[MVP]

    Question: How check if datareader is null?

    Ravikanth[MVP], Aug 12, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    8,411
    VB Programmer
    Aug 12, 2003
  3. VB Programmer
    Replies:
    1
    Views:
    692
    Marina
    Aug 13, 2003
  4. Rob Meade

    DataReader - NextResults question

    Rob Meade, Nov 18, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    688
    Rob Meade
    Nov 19, 2003
  5. =?Utf-8?B?QW5kcmU=?=

    TableAdaptor Update Access database

    =?Utf-8?B?QW5kcmU=?=, Jun 27, 2007, in forum: ASP .Net
    Replies:
    1
    Views:
    366
    Peter Bradley
    Jun 27, 2007
Loading...

Share This Page