ADO.Net Interview Questions and Answers
<< Previous Question Next Question >>
 Question: 1835 Page Views: 

What is a DataReader object?



Posted By: Avi Date: 6 October 2009 05:35:46 AM
 Answer:

DataReader object provides a read-only, forward-only stream of data from a database. The DataReader object is designed for connected scenarios and offers better performance than reading data into a DetaSet object.But DataReader object does not persist contents as in DataSet object.


Posted By: eTechPlanet


Date: 6 October 2009 05:35:46 AM

The DataReader object provides a forward-only, read-only, connected stream recordset from a database. Unlike other components of the Data Provider, DataReader objects cannot be directly instantiated. Rather, the DataReader is returned as the result of the Command object's ExecuteReader method. The SqlCommand.ExecuteReader method returns a SqlDataReader object, and the OleDbCommand.ExecuteReader method returns an OleDbDataReader object. The DataReader can provide rows of data directly to application logic when you do not need to keep the data cached in memory. Because only one row is in memory at a time, the DataReader provides the lowest overhead in terms of system performance but requires the exclusive use of an open Connection object for the lifetime of the DataReader.


Posted By: Johndecruse


Date: 4 February 2010 12:52:10 AM
Post a better Answer if you have
 
(Will show your Gravatar icon)  
  Country flag

Loading
Enter the text as shown in the image DzhmSo
Related Questions
ADO.Net : Can you define relations in data set?

Can you define relations in data set?

Yes
Category: ADO.Net Date: 10/13/2010 10:45:47 PM
ADO.Net : Can you reuse an exisiting open ADO.NET connection with LINQ to SQL?
ADO.Net : To what type ntext type will be mapped in c# code?

To what type ntext type will be mapped in c# code?

SqlTypes.SqlString
Category: ADO.Net Date: 10/13/2010 8:08:47 PM
ADO.Net : Does Recordset exists in ADO.NET?

Does Recordset exists in ADO.NET?

No
Category: ADO.Net Date: 10/13/2010 7:15:48 PM
ADO.Net : How can you fill data set with multiple tables?

How can you fill data set with multiple tables?

Provide two or more queries separated by ; to SqlDataAdapter and use it to fill dataset.
Category: ADO.Net Date: 10/13/2010 5:21:47 PM