midADO.NET
What is the difference between DataReader and DataSet in ADO.NET?
Updated Apr 28, 2026
Short answer
DataReader is fast, forward-only, connected; DataSet is in-memory, disconnected, and supports multiple tables.
Deep explanation
DataReader streams data directly from DB with an open connection, making it highly performant. DataSet loads data into memory, allowing offline operations, relationships, and data manipulation without a DB connection.
Real-world example
Use DataReader for APIs returning large read-only lists; use DataSet for offline editing of related tables.
Common mistakes
- Using DataSet for large datasets
- not closing DataReader.
Follow-up questions
- When should you prefer DataReader?
- When is DataSet useful?