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

How to find methods of a assembly file (not using ILDASM)?

904


What are fields in c#?

675


How does bitwise xor work?

657


What is the difference between system.text.stringbuilder and system.string?

751


Can an abstract class inherit from another abstract class c#?

735


What is data hiding in c#?

687


What is main thread in c#?

693


Explain the difference between arraylist and array and in c#?

703


What are logical operators in c#?

717


How to properly clean up excel interop objects?

704


Can you have more than one namespace in c#?

690


Classes and structs can be declared as static, is this statement true or false?

800


Explain “static” keyword in c#?

646


What is inheritance in csharp?

710


What does namespace mean?

699