a DataReader is a forward-only iterator over a set of results. It's usually the most efficient way to deal with records when you don't need random access (in other words you can't go backwards). It is "scalable" to any number of records, at least in terms of
memory pressure, since it only loads one record at a time. One typical way to get a DataReader is by using theExecuteReadermethod
of a DbCommand.
a DataSet represents a set of DataTable objects. More often than not, it will just contain one table, but if you do a query with multiple SELECT statements, the DataSet will contain a table for each. Because this is an in-memory representation, you have to
be careful about how much data you pull into a DataSet. You can "Fill" a DataSet using theFillmethod
of a DataAdapter.
a DataAdapter is a kind of "pipe" that funnels data from a DB engine into a DataSet. That's why you'll have one DataAdapter implementation for each DB provider type. One DataSet, many providers.
a DataView is like a virtual subset of a DataTable.
Marked as answer by ramthini on May 20, 2012 08:39 AM
DataReader– The datareader is a forward-only, readonly stream of data from the database. This makes the datareader a very efficient means for retrieving
data, as only one record is brought into memory at a time. The disadvantage: A connection object can only contain one datareader at a time, so we must explicitly close the datareader when we are done with it. This will free the connection for other uses. The
data adapter objects will manage opening and closing a connection for the
command to execute
DataAdapter– Represents a set of SQL commands and a database connection that are used to fill the DataSet and update the data source. It serves as a bridge
between a DataSet and a data source for retrieving and saving data. The DataAdapter provides this bridge by mapping Fill, which changes the data in the DataSet to match the data in the data source, and Update, which changes the data in the data source to match
the data in the DataSet. By using it, DataAdapter also automatically opens and closes the connection as and when required.
DataSet– The DataSet is the centerpiece of a disconnected, data-driven application; it is an in-memory representation of a complete set of data, including
tables, relationships, and constraints. The DataSet does not maintain a connection to a data source, enabling true disconnected data management. The data in a DataSet can be accessed, manipulated, updated, or deleted, and then reconciled with the original
data source. Since the DataSet is disconnected from the data source, there is less contention for valuable resources, such as database connections, and less record locking.
DataView– A major function of the DataView is to allow for data binding on both Windows Forms and Web Forms. Usually, a DataView data component is added
to the project to display a sub-set of the records in a DataSet or DataTable. It also acts as filtered and sorted view of data to the DataTable.
DataTable– Represents one table of in-memory data. A DataTable stores data in a similar form to a database table: data is stored in a set of fields (columns)
and records (rows). The DataTable class is a central class in the ADO.NET architecture; it can be used independently, and in DataSet objects. A DataTable consists of a Columns collection, a Rows collection, and a Constraints collection. The Columns collection
combined with the Constraints collection defines the DataTable schema, while the Rows collection contains the data.
ramthini
Member
105 Points
35 Posts
Different between DataReader and DataView?
May 20, 2012 08:12 AM|LINK
Different between DataReader and DataView?
sriramabi
Contributor
4351 Points
1277 Posts
Re: Different between DataReader and DataView?
May 20, 2012 08:12 AM|LINK
Quickly,
a DataReader is a forward-only iterator over a set of results. It's usually the most efficient way to deal with records when you don't need random access (in other words you can't go backwards). It is "scalable" to any number of records, at least in terms of memory pressure, since it only loads one record at a time. One typical way to get a DataReader is by using the
ExecuteReadermethod of a DbCommand.a DataSet represents a set of DataTable objects. More often than not, it will just contain one table, but if you do a query with multiple SELECT statements, the DataSet will contain a table for each. Because this is an in-memory representation, you have to be careful about how much data you pull into a DataSet. You can "Fill" a DataSet using the
Fillmethod of a DataAdapter.a DataAdapter is a kind of "pipe" that funnels data from a DB engine into a DataSet. That's why you'll have one DataAdapter implementation for each DB provider type. One DataSet, many providers.
a DataView is like a virtual subset of a DataTable.
sriramabi
Contributor
4351 Points
1277 Posts
Re: Different between DataReader and DataView?
May 20, 2012 08:13 AM|LINK
check more details
Here is the simple explanation on it.
command to execute
http://www.dotnetspider.com/forum/133184-Datagrid-datalist-datareader-dataview.aspx
ramthini
Member
105 Points
35 Posts
Re: Different between DataReader and DataView?
May 20, 2012 08:39 AM|LINK
Rhank You