What to use for datagrid with a lot of data?

Found this interesting question:

You need to display the sales data for your unit over the past 5 years in the DataGrid in a web form. Performance is very important. What would be the best strategy to use when retrieving data?

  • a) Use a DataReader object to retrieve data for a DataGrid.
  • b) Use a DataSet to retrieve data for a DataGrid.
  • c) Use a simple select statement as a data source for a DataGrid.
  • d) Use the cached XML file as source data and retrieve data using a DataSet.

My answer is: c) but I'm not too sure Can someone please point me to the correct answer and explain it to me, please Thanks

+3
source share
4 answers

Basically, every time a test mentions performance of both DataReader and DataSet, the rule of thumb is DataReader == fast and DataSet == slow.

+1
source

I would use paging .

You can also perform using stored procedures .

+3
source

, A , - , , . DataSets , DataReader , .

select - .

+1
  • , datagrid, .
  • I would suggest that a cached XML file (memomry) is faster than retrieving data from a database, but can also use a significant amount of memory, so that is not the correct answer that I think.
  • The select statement and DataReader are very similar, but you have some additional features with DataReader, so that will be my answer.
0
source

Source: https://habr.com/ru/post/1770375/


All Articles