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
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 |
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 |
How to load multiple tables into a dataset?
What are the major challenges in accessing data from a database?
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();
Explain what are acid properties?
What is the role of the dataset object in ado.net?
What are the advantages of ado.net?
What are the advantages and disadvantages of using datalist?
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?
Which components of a data provider is used to retrieve, insert, delete, or modify data in a data source?
If i am expecting a single result from sqlserverdatabase then what command should i follow ?sqlcommand.executereader (commandbehaviour.singleresult)or sqlcommand.executescalar()
What is the difference in an abstract class and an interface?
What is the difference between oledb sql server and oledbdotnet provider?