How can I convert a DataSet to a DataReader?
Dataset or DataReader? The DataSet class in ADO.Net operates in an entirely disconnected nature, while DataReader is a connection oriented service. DataSet is an in-memory representation of a collection of Database objects including related tables, constraints, and relationships among the tables.
DataReader provides faster performance, but has read-only and forward-only access. DataSet, on the other hand, is high resource-consuming, but offers more control and a disconnected nature.
You can use the following code to change dataset to DataReader
:
DataTableReader rd = ds.Tables[0].CreateDataReader();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With