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

What are methods in C#?

746


What is the difference between list and arraylist in c#?

625


What is concrete method in c#?

718


Why do we need private constructor in c#?

683


Which is the best language for desktop application?

680


What is hashset c#?

719


What is check/uncheck?

842


How does c# achieve polymorphism?

727


What is difference between class and abstract class in c#?

668


Can a abstract class have a constructor?

673


What is the difference between interface and functional interface?

720


What is serialization of data?

761


What are destructors in C#?

1183


How is exception handling implemented in c#?

814


Give an example of a directcast.

720