Difference between dataset & data reader in ado .net
-
- Posts: 295
- Joined: Sat Sep 20, 2014 5:26 pm
- Contact:
Difference between dataset & data reader in ado .net
What is difference between dataset and data reader?
Re: Difference between dataset & data reader in ado .net
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.
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.
Re: Difference between dataset & data reader in ado .net
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
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
Return to “Visual Basic .NET and ASP.NET”
Who is online
Users browsing this forum: No registered users and 1 guest