asp.net
The DataSourceMode property of the SqlDataSource control determines how the extracted data is maintained.
The default value for the DataSourceMode property is the dataset, which means that the result set extracted from the database is stored in a DataSet object in the server's memory, if you use SqlDataSource as the data source for controls such as the GridView, And to sort, filter, and paging in the GridView control, the SqlDataSource DataSourceMode attribute must be set to a dataset.
On the other hand, however, if the data extracted by SqlDataSource is only to be used as an option for controls such as DropDownList and ListBox, and no sorting, filtering and paging processing is required, The DataSourceMode attribute of SqlDataSource should be set to DataReader so as to reduce the consumption of resources. After all, using datasets at such times is simply overkill.
Once you set the DataSourceMode property to DataReader, the data is extracted through a IDataReader object (that is, a straightforward and read-only data pointer), and the result set will not be stored in the server's memory.
If you have a clear understanding of the characteristics and differences of the dataset model and the data command model, you should be able to know when to use the dataset and when to use DataReader.