Whats the difference between IDataAdapter and IDbDataAdapter?

  • Thread starter Thread starter Showjumper
  • Start date Start date
Showjumper said:
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....
 
Thanks Craig
Craig Deelsnyder said:
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....
 
Back
Top