asp.net.ph

Skip Navigation LinksHome > ASP.NET Applications > ASP.NET Optimization > Developing High-Performance ASP.NET Applications

Developing High-Performance ASP.NET Applications

ASP.NET Web Applications   ASP.NET Optimization


Data Access

The following guidelines suggest ways on how to access data more efficiently.

Use SQL Server™ stored procedures for data access

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.

Use the SqlDataReader class for a fast forward-only data cursor

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.

Cache data and page output whenever possible

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.

More ...
Back to top


© 2025 Reynald Nuñez and asp.net.ph. All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note