Professional in C# and Visual Basic Part 115. Building on the revolutionary release, adds several key new developer features including AJAX, LINQ, and a new CSS designer in Visual Web Developer 2008. The dramatic reduction in code that developers realized from the more than 50 new server controls in now allows developers the time to make their applications more interactive with AJAX, to work with data in their preferred language with LINQ, and to build visually attractive and consistent standards-based sites with CSS. . | Chapter 23 Caching SqlConnection AppConnectionString1 .ConnectionString SqlDataAdapter da new SqlDataAdapter Select from Customers conn myCustomers new DataSet myCustomers SqlCacheDependency myDependency new SqlCacheDependency Northwind Customers firmCustomers myCustomers myDependency Produced from database. else Produced from Cache object. myCustomers script In this example the SqlCacheDependency class associated itself to the Customers table in the Northwind database as before. This time however you use the Cache object to insert the retrieved dataset along with a reference to the SqlCacheDependency object. The Insert method of the Cache class is constructed as follows key As String value As Object dependencies As You can also insert more information about the dependency using the following construct key As String value As Object dependencies As absoluteExpiration As Date slidingExpiration As And finally key As String value As Object dependencies As absoluteExpiration As Date slidingExpiration As priority As onRemoveCallback As The SQL Server cache dependency created comes into action and does the same polling as it would have done otherwise. If any of the data in the Customers table has changed the SqlCacheDependency class invalidates what is stored in the cache. When the next request is made the Cache firmCustomers is found to be empty and a new request is made to SQL Server. The Cache object again repopulates the cache with the new results generated. When the page from Listing 23-8 is called for the first time the results generated are shown in Figure 23-8. 1099 Chapter 23 .