以编程方式配置Web.config中的caching.database节点

// Get the Web application configuration.
System.Configuration.Configuration webConfig =
WebConfigurationManager.OpenWebConfiguration("~/");


// Get the section.

System.Web.Configuration.SqlCacheDependencySection sqlDs =
(System.Web.Configuration.SqlCacheDependencySection)webConfig.GetSection(
"system.web/cache/sqlCacheDependency");
原文地址:https://www.cnblogs.com/ejiyuan/p/1314693.html