once data is fetched into dataset connection gets closed. but in datareader
connection is always maintained...then why datareader is fast and mainly
recommended ?

Answers were Sorted based on User's Feedback



once data is fetched into dataset connection gets closed. but in datareader connection is always m..

Answer / hhh

DataSet carry considerable overhead because of relations,
multiple tables,
While DataReader only readony and fawardonly stream of
data, it fatch only one row at a time. thats y its faster

Is This Answer Correct ?    9 Yes 0 No

once data is fetched into dataset connection gets closed. but in datareader connection is always m..

Answer / abhishek

datareader is forwardonly thus is fast and is mostly used
while retrieving the data from the database.

Is This Answer Correct ?    5 Yes 0 No

Post New Answer

More ADO.NET Interview Questions

How to load multiple tables into a dataset?

0 Answers  


What are the major challenges in accessing data from a database?

0 Answers  


How To Update A Column In A DataGrid Using C#.NET? I am getting InvalidCastException as (Specified cast is not valid) while updating 2nd column in a datagrid? Id,firstname,lastname are the three columns of my datagrid respectively. I wanted to edit the second column(lastname) and update it. I did the following code in DataGrid's updatecommand(),but failed to update ! Int varid=(int)DataGrid1.DataKeys[e.Item.ItemIndex]; TextBox lnm=(TextBox)e.Item.Cells[2].Controls[0]; string str=lnm.Text ; SqlCommand cmd=new SqlCommand("update customer set lastname='" + str + "' where id=" + varid + "",con); cmd.ExecuteNonQuery(); DataGrid1.EditItemIndex=- 1; DataGrid1.DataBind();

2 Answers   Mind Tree, TCS,


Explain what are acid properties?

0 Answers  


What is the role of the dataset object in ado.net?

0 Answers  






What are the advantages of ado.net?

0 Answers  


What are the advantages and disadvantages of using datalist?

0 Answers  


What provider ado.net use by default? Explain the role of data provider in ado.net? What is the role of data provider in ado.net?

0 Answers  


Which components of a data provider is used to retrieve, insert, delete, or modify data in a data source?

0 Answers  


If i am expecting a single result from sqlserverdatabase then what command should i follow ?sqlcommand.executereader (commandbehaviour.singleresult)or sqlcommand.executescalar()

4 Answers  


What is the difference in an abstract class and an interface?

0 Answers  


What is the difference between oledb sql server and oledbdotnet provider?

0 Answers  


Categories