由于项目需要,准备采用缓存机制,打算模仿petshop 4.0中的缓存设计方式,资料显示,petshop 4.0是采用的SQL Server 2000的数据库,是采用轮询的方式查询数据库更新的,原因是SQL Server 2000不支持查询更改通知,但我的项目的是采用SQL Server 2008 R2的数据库,采用轮询的方式就显得不太经济,那么,对petshop的缓存架构该如何改造才能适应SQL Server 2008 R2的数据库呢?在petshop 4.0中的TableCacheDependency项目中,有如下代码/// <summary>
        /// The constructor retrieves all related configuration and add CacheDependency object accordingly
        /// </summary>
        /// <param name="configKey">Configuration key for specific derived class implementation</param>
        protected TableDependency(string configKey)
        {
            string dbName = ConfigurationManager.AppSettings["CacheDatabaseName"];
            string tableConfig = ConfigurationManager.AppSettings[configKey];
            string[] tables = tableConfig.Split(configurationSeparator);            foreach (string tableName in tables)
                dependency.Add(new SqlCacheDependency(dbName, tableName));
        }其中的dependency.Add(new SqlCacheDependency(dbName, tableName));就是明显轮询方式使用缓存,而SQL  2008的数据库可以使用SqlCommand构造SqlCacheDependency实例,那么,这个SqlCommand应该如何写呢?望熟悉petshop和asp.net缓存依赖的同行们能给我一个解决方案,先谢过各位了!