What is the best method to fill the GridView. using
SqlDataReader or Dataset and why

Answer Posted / vasanth

Dataset is the better option then datareader. Since dataset is disconnected, once data can be fetched and stored in dataset and then disconnect the connection and then you can bind to gridview.
In Datareader you are fetching each row and you are binding. So in middle if connection goes off, then half of the data is binded to gridview.
So dataset is better then datareader.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can properties be overloaded in c#?

541


Is c# the same as d flat?

495


What are destructors in C#?

831


Is c# pass by value?

483


What is the function of .IsDescendent()?

573






What are fields in c#?

493


What is file extension of webservices?

574


Illustrate the process of code compilation in c#?

517


You are creating a custom usercontrol, some of the newly created properties are shown in the properties window. How you can hide a new property named theme from the properties window?

492


What is the difference between returning iqueryable vs ienumerable?

446


What is a view? What is the use of it?

578


What are the differences between events and delegates in c#?

458


What is difference between class and interface in c#?

448


How do I port "synchronized" functions from visual j++ to c#?

478


What happens during the process of boxing?

592