HI Can any one explain me how to implement SQL Dependency Caching in Asp.Net?
A:
How you implement SQL dependency caching will depend on the version of SQL server you are using. I would suggest reading this MSDN article to get a better understanding of how it hangs together.
Andy Rose
2010-09-29 08:20:52
Am using SQL Server 2008
programmer4programming
2010-09-29 08:27:51
A:
See David Hayden's article on the subject for an example.
Generally you connect the dependency to a command and add the dependency when inserting into the cache.
var command = new SqlCommand("SELECT something FROM dbo.ATable", connection);
var dependency = new SqlCacheDependency(command);
var result = ObtainResultUsingThe(command);
Cache.Insert("CacheKey", result, dependency);
Observe that special rules apply for your queries. Among others:
- Named columns must be selected (no SELECT *)
- Must use fully qualified name of table (e.g. dbo.ATable)
Edit:
For using the dependency in caching an entire page, you can follow this example.
PHeiberg
2010-09-29 08:36:25
A:
hi answer with implementation can be found at below site
http://harismile.wordpress.com/2010/09/09/mvc-with-ef-sqldependencycache/
hari
2010-10-22 08:22:36