I keep hearing DbDataAdapter this days. It is an abstract class of adapter.

But When should i prefer DbDataAdapter over DataAdapter, and what is the difference between DbDataAdapter and DataAdapter(on performance and functionality)?

有帮助吗?

解决方案

As you said, DbDataAdapter is an abstract class, that inherits from DataAdapter. As said in MSDN:

Inheritors of DbDataAdapter implement a set of functions to provide strong typing, but inherit most of the functionality needed to fully implement a DataAdapter.

And for perfomance, here:

If you are connecting to a SQL Server database, you can increase overall performance by using the SqlDataAdapter along with its associated SqlCommand and SqlConnection objects.For OLE DB-supported data sources, use the DataAdapter with its associated OleDbCommand and OleDbConnection objects.For ODBC-supported data sources, use the DataAdapter with its associated OdbcCommand and OdbcConnection objects.For Oracle databases, use the DataAdapter with its associated OracleCommand and OracleConnection objects.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top