The following guidelines suggest ways on how to access data more efficiently.
Of all the data access methods provided by the .NET Framework, SQL Server-based data access is the recommended choice for building high-performance, scalable Web applications.
When using the managed SQL Server™ provider, you can get an additional performance boost by using compiled stored procedures instead of ad-hoc queries. For information about using SQL Server™ stored procedures, see Using Stored Procedures with a Command.
The SqlDataReader class provides a means to read forward-only data stream retrieved from a SQL Server™ database.
When creating your ASP.NET application and situations arise that allow you to use it, the SqlDataReader class offers higher performance than the DataSet class. This is because SqlDataReader uses the Tabular Data Stream ( TDS ) protocol to read data directly from a database connection. In addition, the SqlDataReader class implements the IEnumerable interface, which allows you to bind data to server controls as well.
For more information, see the SqlDataReader Class. For information how ASP.NET accesses data, see Accessing Data with ADO.NET.
ASP.NET provides simple mechanisms for caching page output or data when they do not need to be computed dynamically for every page request. In addition, designing pages and data requests to be cached, particularly in areas of your site that you expect heavy traffic, can optimize the performance of those pages.
More than any feature of the .NET Framework, using the cache appropriately can make or break the performance of your site, sometimes by more than an order of magnitude. For information about how to cache page output and data requests, see ASP.NET Caching Features.