asp.net.ph

SqlDataSource.EnableCaching Property

System.Web.UI.WebControls Namespace   SqlDataSource Class


.NET Framework version 2.0

Sets or retrieves a value indicating whether the SqlDataSource control has data caching enabled.

Syntax


Inline <asp:SqlDataSource enablecaching = boolValue ... >
Script SqlDataSource.EnableCaching [ = boolValue ]

Property Value


boolValue true if data caching is enabled for the data source control; otherwise, false. Default value is false.

The property is read/write with no default value.

Exceptions


Exception Type Condition
NotSupportedException The EnableCaching property is set to true when caching is not supported by the SqlDataSource.

Remarks

The SqlDataSource control supports data caching. While data is cached, the Select method retrieves data from the cache rather than from the underlying database. When the cache expires, the Select method retrieves data from the underlying database, and then caches the data again.

The SqlDataSource control automatically caches data when the EnableCaching property is set to true and the CacheDuration property is set to a value greater than 0, which indicates the number of seconds that the cache stores data before retrieving a fresh set.

NOTE: When you are using client impersonation under Microsoft Windows authentication, the data is cached when the first user accesses the data. If another user requests the same data, the data is retrieved from the cache. The data is not retrieved by making another call to the database to verify the user's access to the data. If you expect more than one user to access the data, and you want each retrieval to the data to be verified by the security configurations for the database, do not use caching.

Skip Navigation Links



Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

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

You can help support asp.net.ph