Questions tagged [sqlcachedependency]

Establishes a relationship between an item stored in an ASP.NET application's Cache object and either a specific SQL Server database table or the results of a SQL Server 2005 query

System.Object
. System.Web.Caching.CacheDependency
. . System.Web.Caching.SqlCacheDependency

Namespace: System.Web.Caching
Assembly: System.Web (in System.Web.dll)

On all supported versions of SQL Server (Microsoft SQL Server 7.0, Microsoft SQL Server 2000, and SQL Server 2005) the SqlCacheDependency class monitors a specific SQL Server database table. When the table changes, items associated with the table are removed from the Cache, and a new version of the item is added to the Cache.

http://msdn.microsoft.com/en-us/library/system.web.caching.sqlcachedependency.aspx

78 questions
1
vote
0 answers

How to customize output cache action filter where it's cache by sql query in mvc

Is there any way to cache data based on SQL query for table in mvc i have tried following filter and it successfully cache list based on taskId but now when any row changes which contain this taskid need to fetch data from table. (Duration = 300,…
1
vote
1 answer

Calling SqlDependency.Start two times continuously, the second time failed?

The purpose of calling SqlDependency.Start multiple times is to ensure it's fine before some other action such as creating a new instance of SqlCacheDependency based on a Command. According to Microsoft's document about SqlDependency.Start at here…
Hopeless
  • 4,397
  • 5
  • 37
  • 64
1
vote
0 answers

Asp.net sql cache dependency programmatically configuration

I've a question regarding SqlCacheDependency configuration. Every resource I've read requires the developer to define the polled databases into web.config. This is not a good scenario for our application that connects to different databases, because…
Marconline
  • 1,108
  • 12
  • 30
1
vote
0 answers

Asp.net MVC SqlCacheDependency

My application seems tobe taking time while loading data into a grid and I was looking for SqlCacheDependency are there any limitations of using this a part from retrieving when data is modified. Also I was looking for some blogs/sample for MVC…
Harry
  • 338
  • 1
  • 6
  • 19
1
vote
1 answer

Possibility to add database in sqlCacheDependency collection without web.config

Situation is like this: I have two projects. One Asp.net and one project which does all data related stuff with database. I keep my connectionstring in a seperate encrypted XML file. Now instead of requesting all data constantly from sql. I want to…
Youszef
  • 43
  • 1
  • 5
1
vote
1 answer

What is the best way for cahcing an irregular changing data - table in MVC 4?

I am a web developer on MVC 4 and want to use the cache concept to improve the speed of my home page. My website is a portal for sports and I have a slider in my home page which show the online result of matches. The match results data may change…
A.Dara
  • 784
  • 10
  • 23
1
vote
3 answers

Why does stored procedure invalidate SQL Cache Dependency?

After many hours, I finally realize that I am working correctly with the Cache object in my ASP.NET application but my stored procedures stops it from working correctly. This stored procedure works correctly: CREATE PROCEDURE…
1
vote
0 answers

sqlDatasource and sqlCacheDependancy

this is my sqldatasource:
Mahdi_Nine
  • 14,205
  • 26
  • 82
  • 117
1
vote
1 answer

SqlCacheDependency via Service Broker Notification in a WebEdition of SqlServer 2008 R2

I would appreciate Your help: We are planing to buy SQL Server 2008 R2 Web Edition (we must this version), however we would also like to use a functionality of Service Broker for SqlCacheDependency - Notification Mode (NOT polling…
1
vote
1 answer

How do I check if SqlCacheDependency is enabled at runtime?

I am using SqlCacheDependency with polling in an ASP.NET project. Sometimes, I need to disable SqlCacheDependency, which I do as follows:
frankadelic
  • 20,543
  • 37
  • 111
  • 164
1
vote
1 answer

SqlCacheDependency problems when upload on server

I used SqlCacheDependency in my website and it works on localhost without problem. but when Upload it on server and restore my database it has following error: The SQL Server Service Broker for the current database is not enabled, and as a result…
Mahdi_Nine
  • 14,205
  • 26
  • 82
  • 117
1
vote
1 answer

aspnet_regsql SQLCACHEDEPENDENCY

I have created a datatbase "testschema" and schema called "MySchema". I have created a table "MySchema.table1" in the database. I am trying to create sql cache dependancy on table using aspnet_regsql utitlity. MySchema.Table1 But it throw an…
arik
  • 338
  • 1
  • 16
0
votes
2 answers

ASP.NET Output Caching vs ASP.NET Object Caching

Can you please help me with deciding which one of the following scenarios will work the best. I have 3 user controls. Each control needs to generate content based on the results of SQL Server query, for example user control #1 populates a gridview…
0
votes
1 answer

Caching a SQL Server Query with Multiple Result Sets

I am trying to cache a SQL Stored Procedure with multiple results sets by making use of the SQLCacheDependency class. The first three queries in the stored procedure are queries that are general to all the users on the website, and the fourth…
Curious Coder
  • 177
  • 1
  • 11
0
votes
2 answers

SqlCacheDependency not working when using SqlCommand for cache-key

This code works fine, it invalidates the data whenever it is changed in the database: AggregateCacheDependency aggDep = new AggregateCacheDependency(); System.Data.SqlClient.SqlCommand ocom = new…
Greg Snider
  • 143
  • 1
  • 9