How is Datareader different from Dataset in ADO.NET?

Dataset and Datareader are the two main objects of ADO.NET that are used to read and manipulate data from data store.



Differences between them are tabulated below:

Dataset
Datareader
The data store whose records have to be manipulated can be disconnected. You can read data from datareader only if the connection to data store exists.
You have the provision to cache data fetched from data store when using dataset. Caching of data is not possible.
Dataset objects have XML Support. XML Support is not provided by datareader.
A single dataset object can contain collection of datatable objects wherein each datatable object refers to a table in the datastore. Hence you can manipulate on multiple tables using a dataset. Datareader can read records fetched by a command object containing a single query. If you have to fetch data from multiple tables, then datareader is not advantageous when compared to dataset.
Using dataset, you can read the records fetched in any order. While reading records, you can iterate only in forward direction.
Performance wise, dataset is slow because it has multiple tables which in turn include multiple rows, columns and constraints. Datareader gives high performance and records can be fetched faster when compared to dataset.

| How do you implement Observer Design Pattern in .NET? | How do you pass data between different Tiers in .NET Architecture? | How is Classic ADO different from ADO.NET? | How is Dataadapter useful in ADO.NET? | How is Datareader different from Dataset in ADO.NET? | How is .NET Application Development different from Traditional Development? | How is HashTable different from ArrayList in .NET? | How is Inheritance achieved in C#? | How is new keyword different from override keyword during inheritance in .NET? | How is String class different from StringBuilder class in .NET? | Illustrate ADO.NET Architecture | Illustrate the importance of Server.Transfer and Response.Redirect in .NET? | Mention the different objects available in Dataset of ADO.NET | Mention the usage of Connection Object in ADO.NET | What are the commonly used methods of Dataadapter in ADO.NET? | What are the different Behavioral Design Patterns that can be used in .NET Architecture? | What are the different Creational Design Patterns that can be used in .NET Architecture? | What are the different Structural Design Patterns that can be used in .NET Architecture? | What are the methods provided by Command Objects in ADO.NET? | What is Internal Access Modifier in C#? |


“Amazon and the Amazon logo are trademarks of Amazon.com, Inc. or its affiliates.”

| Privacy Policy for www.dotnet-guide.com | Disclosure | Contact |

Copyright - © 2004 - 2024 - All Rights Reserved.