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 is the wildcard character in sql?

526


Are structs value types c#?

478


What is inline function in c#?

515


How will you get the different language strings?

510


Give an example of a directcast.

524






What is the difference between proc. Sent by val and by sub?

484


What is singleordefault?

519


How to prevent the error while updating ui control from another thread?

508


How do you serialize an object?

534


Is comparable a functional interface?

512


What is JIT (just in time)? how it works?

560


Is var a data type?

512


What is the benefit of dependency injection c#?

491


Can the accessibility of a type member be greater than the accessibility of its containing type?

567


What are custom exceptions? Why do we need them?

529