sqldependency

SqlCacheDependency in n-Tier Architekture

I read some articles about SqlCacheDependency. I think it is a really cool way for updating caches, but i'm not sure how i can handle this technologie if my application is a n-tier architekture. Is this just useful if my program is a small webapplication, or is there also a way for use in big n-tier architektures? ...

Invalid Sql Cache Dependency, SELECT TOP statements and pagination queries using ROW_NUMBER()

I have found that regular pagination methods (for example, 2 nested SELECT staments that use ROW_NUMBER() to create a temporary field) do not allow SqlCacheDependency to work properly when we set the dependency to work on a command (it only works well if it depends on the table which is not the desired effect). The same happens when I u...

Returning data from sqldependency

I'm trying to write a vb.net application that uses an sql dependancy. The dependancy will be triggered when data is added to the database. I'm wondering if it's possible to have the dependancy return the data/query that triggered it. currently i have to have the onchange event trigger a select statement to refresh the data i have cach...

Windows Application SqlDepedency Calling Onchange infinitely

Hi, I have console application in which I am doing sqldependency. My problem is when I set commandType as Text, it is working fine. But if I use commandType as StoredProcedure, onchange method is calling infinitely. Please see the code below: static DataSet myDataSet; static SqlConnection connection; static S...

SQL Dependency with SQL Server express 2005

Is it possible to use SQL Dependency with SQL Server Express 2005 which comes with VS 2008? ...

Cache drop if query has WHERE Clause

Hi, I am using SqlDependency and CacheManager class(Enterprise library Cachcing block) to create a cache in one of vb.net project. I have registerd OnDependencyChanged(ByVal sender As Object, ByVal e As SqlNotificationEventArgs) method to get the notification back from Sql Server 2005. Now the problem is, if the query does not co...

SQL Server Notifications - My OnChange does not fire.

Hey eveyone.. I would like to make use of SQL Server notifications to capture insert events at my database within a winforms app. I am attempting to use the SQLDependency object. The MSDN articles make this seem pretty straight forward. So I have created a little example application to give it a try. The event only seems to fire as I en...

Production SqlSiteMapProvider issue - all the items 'disappeared'?

Hello, We have several ASP.NET applications that use a sitemap which is populated via a VB.NET implementation of the SqlSiteMapProvider example found at Wicked Code. It is compiled to a DLL, then installed and referenced from the GAC on the servers and from our locals as well. It has been working in production just fine for a few months...

How to apply Sql Dependency in ASP.NET MVC?

How can we apply Sql Dependency in Asp.Net MVC for cached objects? ...

SqlDependency query with WHERE clause not allowed. How can I modify it to be valid?

I have a SqlDependency set up using the following query: string sql = "SELECT dbo.Case.CMRID, dbo.Case.SolutionID, dbo.Case.CreateDT, dbo.Case.ModifyDT " + "FROM dbo.Case " + "WHERE dbo.Case.ModifyDT > '" + LastExecutionDateTime + "'"; Executing this query causes the OnChanged event to fire continuously with a type of Invalid and Sour...

NHIbernate SysCache2 and SQLDependency problems

Hi, I've set enable_broker on my SQL Server 2008 to use SQLDepndency I've configured my .Net app to use Syscache2 with a cache region as follows: <syscache2> <cacheRegion name="BlogEntriesCacheRegion" priority="High"> <dependencies> <commands> <add name="BlogEntries" command="Sel...

Elect one web application instance to perform a task triggered by an external event?

I have an ASP.NET application running on multiple IIS6 web servers, with a SQL Server 2005 database back-end. I need to: monitor the database for the completion of an external job event, and then have exactly one web application instance submit some information to a web service For (1) it seems like a SqlDependency would be the best...

How to track changes in many SQL Server databases from .NET application?

Problem: There are a lot of different databases, which is populated by many different applications directly (without any common application layer). Data can be accessed only through SP (by policy) Task: Application needs to track changes in these databases and react in minimal time. Possible solutions: 1) Create trigger for each ta...

SQLDependency thread

i am in the process implementing SQLdepenency i would like to know in case of Dependency Handler exeuctues will it spun a different thred from main Process ? What will happen when the event handler triggers? Do i need to worry about any multithreds issues? public void CreateSqlDependency() { try { using (SqlConnection co...

ASP.NET MVC <OutputCache> SqlDependency (CommandNotification?) with LINQ queries

Hello, I use LINQ queries in my ASP.NET MVC application and want to use OutputCache in some of my Actions. I hear this should be possible with CommandNotifications. But those seem to only go for self-created SQLCommands, or am I wrong? Can I manually tell SQL server to send SQLDependency notifications if certain tables change? And if...

How to setup SqlDependency to monitor multiple tables

I am trying to figure out how to monitor more than one table with a SqlDependency. All the examples I have found are for one table. I have multiple classes that represent a monitor for a specific table. Each time a change event is raised I stop the dependency and start a new one but that unhooks the other monitors. How do I get it to...

SqlDependency throwing Invaild Operation exception

In our project we are invalidating the cache based on the change in the query output. This is implemented using change notifications. In the Global.asax file in the Application Start block we have also added SqlDependency.Start(ConnectionStr). But still its throwing the following invalid operation exception Message "When using SqlDepend...

LINQ to SQL and SqlDependency

Hi All, Are there any implications of using SqlDependency and LINQ to SQL together. Or do we have to take care of some things specially to make them work properly? In our application we are using LINQ to SQL as an ORM and business logic is in the Stored Procedures. We cache the output of the SPs and create SQLDependency. Whenever the o...

Methods to enable Sql Notification Services

Hi All What is the difference in the following mentioned things, are these used for differnet purposes or are they used collectively for some functionality, can anyone please differentiante among these based on their functionalities: 1) SqlCacheDependencyAdmin.EnableNotifications(ConnStr) 2) AspNet_RegSql.exe -S "ServerName" -d "...

SqlDependency in asp.net

I'm using SqlDependency to control my cache. I want to use it to monitor several tables (around 10). There should be one SqlDependency per watched table. Should I create for each of them code like that: public void CreateDependency_Table() { if (connectionStringSettings != null) { using (SqlConnection...