Whats the difference between IDataAdapter and IDbDataAdapter?

Discussion in 'ASP .Net' started by Showjumper, Jan 20, 2004.

  1. Showjumper

    Showjumper Guest

    Whats the diff between the 2 and when do you use one and not the other?
     
    Showjumper, Jan 20, 2004
    #1
    1. Advertising

  2. Showjumper wrote:
    > Whats the diff between the 2 and when do you use one and not the other?
    >
    >

    from the docs:

    The IDataAdapter interface allows an inheriting class to implement a
    DataAdapter class, which represents the bridge between a data source and
    a DataSet.

    The IDbDataAdapter inherits from IDataAdapter and is specific to when
    you're using a relational database as your data source. Data sources
    don't have to be databases, you could have adapters to other external
    systems, an XML file, other data files could be data sources as well.

    Usually you don't use the interfaces directly (as a type) unless your
    code could be one of many different types of datasources or DBs at the
    same time. For example, if you have code that needs to run using
    SQLServer and/or Oracle in your current environment, and you want it to
    be switchable (the same code block run with either type of database).

    Or if you have a new type of datasource you'd like to add
    DataSet-related capabilities to interact with, you would create classes
    based on these interfaces....

    --
    Craig Deelsnyder
    Microsoft MVP - ASP/ASP.NET
     
    Craig Deelsnyder, Jan 20, 2004
    #2
    1. Advertising

  3. Showjumper

    Showjumper Guest

    Thanks Craig
    "Craig Deelsnyder" <cdeelsny@NO_SPAM_4_MEyahoo.com> wrote in message
    news:...
    > Showjumper wrote:
    > > Whats the diff between the 2 and when do you use one and not the other?
    > >
    > >

    > from the docs:
    >
    > The IDataAdapter interface allows an inheriting class to implement a
    > DataAdapter class, which represents the bridge between a data source and
    > a DataSet.
    >
    > The IDbDataAdapter inherits from IDataAdapter and is specific to when
    > you're using a relational database as your data source. Data sources
    > don't have to be databases, you could have adapters to other external
    > systems, an XML file, other data files could be data sources as well.
    >
    > Usually you don't use the interfaces directly (as a type) unless your
    > code could be one of many different types of datasources or DBs at the
    > same time. For example, if you have code that needs to run using
    > SQLServer and/or Oracle in your current environment, and you want it to
    > be switchable (the same code block run with either type of database).
    >
    > Or if you have a new type of datasource you'd like to add
    > DataSet-related capabilities to interact with, you would create classes
    > based on these interfaces....
    >
    > --
    > Craig Deelsnyder
    > Microsoft MVP - ASP/ASP.NET
     
    Showjumper, Jan 20, 2004
    #3
    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. jakk
    Replies:
    4
    Views:
    12,403
  2. exquisitus
    Replies:
    1
    Views:
    12,325
    Eric Sosman
    May 4, 2005
  3. Old Wolf
    Replies:
    3
    Views:
    332
    Ben Measures
    Apr 3, 2004
  4. gk
    Replies:
    0
    Views:
    935
  5. David

    IDbDataAdapter and Fill

    David, Apr 22, 2008, in forum: ASP .Net
    Replies:
    1
    Views:
    593
    Peter Bromberg [C# MVP]
    Apr 23, 2008
Loading...

Share This Page