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
2
votes
0 answers

Using SQLDependency or SqlCacheDependency with Repository pattern

I am building an ASP.NET MVC application using the Repository pattern. A typical method in my Repository is as follows public IList Select(string cacheKey, string Sql, object filter) where T: new() { IList items =…
2
votes
1 answer

how to use sqlcachedependency for each user in asp.net mvc

I have an application in asp.net mvc (C#), in which each user have different products sharing a common table separated by user id. I need to implement SqlCacheDependency for each user's products. The Scenario is: say there are two users (user1 and…
Prasad
  • 58,881
  • 64
  • 151
  • 199
2
votes
1 answer

ASP.NET set cache dependency with a SqlCommand

Is this an effective way to set the cache item dependent on the query? HttpRuntime.Cache.Insert( "ListLanguages", list, new SqlCacheDependency(command), …
Fabio Milheiro
  • 8,100
  • 17
  • 57
  • 96
2
votes
1 answer

What is the exact role of "AspNet_SqlCacheTablesForChangeNotification"

We have a .NET 4.5 Azure Webrole with Azure (colocated) Caching enabled. We use Entity Framework 5.0 talking to an Azure SQL database. We did some cleanup on our staging/testing and I noticed that the entity framework edmx file complains that…
DeepSpace101
  • 13,110
  • 9
  • 77
  • 127
1
vote
1 answer

can the asp page be auto refreshed trigger by database change using sqlCacheDependency

I've spent 2 whole weeks in googling some working sample on this. I was almost kind of knocking my head against concrete wall....deeply suffering until now. Ok, I have a simple web page to display two columns, say, Msg & MsgID, from a table named…
1
vote
3 answers

Determine if SqlDependency.Start(connectionstring) has been called in current project?

Our applications use a lot of shared components. Some of them have no need for caching, for example, Windows Services which process unmailed emails. You'd never cache that result set... Problem is, since our shared data layer has been modified to…
The Evil Greebo
  • 7,013
  • 3
  • 28
  • 55
1
vote
1 answer

SqlCacheDependency with SqlCommand not working

Having problems with implementing very basic SqlCacheDependency prototype. Have tried this with a sproc but now I'm down to straight command execution. public SqlCommand GetReadCommand(int ID) { SqlCommand cmd = new…
The Evil Greebo
  • 7,013
  • 3
  • 28
  • 55
1
vote
2 answers

SqlCacheDependency with LINQ2SQL (Repository Pattern)

I am using L2S Repository pattern in my ASP.Net 3.5 web app. But I am not quite satisfied with the performance as experienced on the live. I searched google and came across SQL Caching using SqlCacheDependency Class. But i have'nt got any tutorial…
user240141
1
vote
1 answer

auto refreshing page when data in database is changed

my page is using sqlcachedependency. so the page read information from cache until data in database is changed but i need the page was auto refresh when data is changed. How can i do that?
Mahdi_Nine
  • 14,205
  • 26
  • 82
  • 117
1
vote
1 answer

SqlDependency.Start An attempt to attach an auto-named database for file failed

iv'e got copy of NORTHWND.mdf along with NORTHWND.LOG in my App_Data folder MY CONNECTION STRING :
eran otzap
  • 12,293
  • 20
  • 84
  • 139
1
vote
1 answer

NHibernate + SysCache2 + SqlCacheDependency - Cache not invalidating in application

I have a basic MVC application that is using NHibernate for OR/M and data access, SysCache2 for the second-level cache in NHibernate, and SqlCacheDependency for the underlying cache invalidation logic. I believe I have everything setup correctly (I…
1
vote
0 answers

A few questions about SqlDependency/SqlCacheDependency

I have a few questions that i would like to clear Can u use SqlDependency or SqlCacheDependency to find out which particular data item has changed in the database? Right now , i am using SqlCacheDependency by having a background thread that…
CuriousCoder
  • 1,582
  • 5
  • 28
  • 55
1
vote
2 answers

Delete HttpRuntime.Cache items from an other application

I have an admin application in which I manipulate my objects in the db, and a public asp.net mvc application which is mostly for viewing these objects. I have implemented a simple caching for a few objects, which uses HttpRuntime.Cache. I want to…
vinczemarton
  • 7,756
  • 6
  • 54
  • 86
1
vote
1 answer

SQLServer OutputCache objects deleted or not created

In this project I'm using MVC-3, with output cache attributes and the appropriate references in the web.config and, hopefully, the global.asax (below). I'm running production from a shared hosting and can't run aspnet_regsql as a admin to create…
1
vote
2 answers

Global settings for ASP.NET website

I'm trying to create a sort of global settings for a website and store this data on the database, however I keep thinking that may not be very efficient as these settings will have to be read on every request. The type of settings like 'how many…
Nelson Pires
  • 321
  • 4
  • 12