I like to know the difference between this two...
Difference Between odbcdatareader and odbcdataadapter
Collapse
X
-
Tags: None
-
Both the reader and the adapter are used to read data returned by a select statement. The reader, however, is a quite simple and fast cursor, allowing you to get single values of each row sequentially as long as the connection to the database is open. The dataAdapter, however, reads the whole result and fills it into a dataset. There, you can access your values randomly and need not to bother about the connection to the database.
If you manipulate data in the DataSet, the changes will be applied only in memory. Of course there is a command to commit all changes to the database. Using the DataReader, you need to write your own UPDATE-Commands in order to change data.
If you want more detailled information about DataAdapters and DataSets, you should have a look at MSDN. They explain it quite good there. -
DataReader gives you the fastest way to access data using a connected model that provides ForwardOnly/ReadOnly data.
DataAdapter is used to read data from DataSource and fill a DataSet then disconnect. It uses a DataReader to read the data. Upon demand, it sends the updates to the Database after reconnecting again then disconnecting.Comment
Comment