سؤال

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