Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I convert DataSet a to a DataReader?

How can I convert a DataSet to a DataReader?

like image 788
anjum Avatar asked Aug 20 '10 09:08

anjum


People also ask

What is difference between DataSet and 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.

Which is better DataReader or DataSet?

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.


1 Answers

You can use the following code to change dataset to DataReader:

DataTableReader rd = ds.Tables[0].CreateDataReader();
like image 79
Raghavendra Devraj Avatar answered Sep 21 '22 09:09

Raghavendra Devraj