Difference between dataset & data reader in ado .net

Post a reply

Confirmation code
Enter the code exactly as it appears. All letters are case insensitive.
Smilies
:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :arrow: :| :mrgreen: :geek: :ugeek:

BBCode is ON
[img] is ON
[flash] is ON
[url] is ON
Smilies are ON

Topic review
   

If you wish to attach one or more files enter the details below.

Expand view Topic review: Difference between dataset & data reader in ado .net

Re: Difference between dataset & data reader in ado .net

Post by jerrymanly » Tue Dec 01, 2015 8:47 am

DataSet is an in-memory representation of a collection of Database objects including related tables, constraints, and relationships among the tables. It provides a consistent relational programming model with multiple data sources from different areas. We can say that the DataSet is a small database because it stores the schema and data in the application memory area. Dataset is used to hold tables with data. You can select data form tables, create views based on table and ask child rows over relations. Also DataSet provides you with rich features like saving data as XML and loading XML data.

DataReader is designed to retrieve a read-only, forward-only stream of data from data sources. DataReader has a connection oriented nature, whenever you want fetch the data from database that you must have a connection. It's usually the most efficient way to deal with records when you don't need any random access. It fetches one row at a time so very less network cost when compare to DataSet. Results are returned as the query executes, and are stored in the network buffer on the client until you request them using the Read method of the DataReader. DataReader is readonly so we can't do any transaction on them. It will be the best choice where we need to show the data to the user which requires no transaction. More about....
difference between Dataset and DataReader

Jerry

Re: Difference between dataset & data reader in ado .net

Post by Guest » Tue Jul 28, 2015 11:24 am

DataReader
DataReader is used to read the data from database and it is a read and forward only connection oriented architecture during fetch the data from database. DataReader will fetch the data very fast when compared with dataset. Generally we will use ExecuteReader object to bind data to datareader.

DataSet
DataSet is a disconnected orient architecture that means there is no need of active connections during work with datasets and it is a collection of DataTables and relations between tables. It is used to hold multiple tables with data. You can select data form tables, create views based on table and ask child rows over relations. Also DataSet provides you with rich features like saving data as XML and loading XML data.

Difference between dataset & data reader in ado .net

Post by Ladva Nidhi » Sun Oct 26, 2014 10:15 am

What is difference between dataset and data reader?

Top