Questions tagged [sqldependency]

The SqlDependency object represents a query notification dependency between an application and an instance of SQL Server. An application can create a SqlDependency object and register to receive notifications via the OnChangeEventHandler event handler.

The SqlDependency object represents a query notification dependency between an application and an instance of SQL Server. An application can create a SqlDependency object and register to receive notifications via the OnChangeEventHandler event handler.

MSDN Documentation

454 questions
0
votes
2 answers

Polling for database changes: SqlDependency, SignalR is Good

I need to show changes to data in a database through SqlDependency and SignalR. Suppose my transaction table is often changed by many people. Suppose in a few seconds, the data is changed many times, then I would like to know how notifications will…
Thomas
  • 33,544
  • 126
  • 357
  • 626
0
votes
2 answers

Cache is not getting refreshed in sqldependancy

I want to refresh the data automatically when change to the database is made. I used this documentation: And made the code on page load as: protected void Page_Load(object sender, EventArgs e) { conString = "Data…
C Sharper
  • 8,284
  • 26
  • 88
  • 151
0
votes
1 answer

Multiple SQL Dependencies on same table

I need to have two SQL dependencies on the same table as I have to monitor them for different reasons. So I wrote the following two queries - **SELECT [ID], [COLUMN1] FROM DBO.TABLENAME WHERE SOMECOLUMN = VAL1 ORDER BY ID** **SELECT [ID], [COLUMN2]…
JunaidKirkire
  • 878
  • 1
  • 7
  • 17
0
votes
1 answer

Scriptmanager register javascript not working inside event

i 'm using SqlDependency for a real-time ASP.NET application. And i'm using some javascript methods on my almost whole project that i can register with ScriptManager like: ScriptManager.RegisterStartupScript(this, typeof(Page), new Random().Next(0,…
Sercan Ozdemir
  • 4,641
  • 3
  • 34
  • 64
0
votes
1 answer

Service broker - conversation handle not found messages in SQL Server error log

Many threads opened on this topic, none seem to have an answer for my problem so i am going to give it a try.. System : Windows Server 2012 SQL Server 2012 Enterprise edition Problem : We are using SQLDependency to enable use of query…
0
votes
2 answers

SQLDependency with SignalR and MVC. OnChange only firing once

I am able to display real time row updates on my websites dashboard. However, when trying to do almost exactly the same thing with notifications my onchange event only fires once. The SignalR connection is being used by the dashboard updates and it…
m0r6aN
  • 850
  • 1
  • 11
  • 19
0
votes
2 answers

Force UpdatePanel with datalist to refresh on database changed - SqlDependency

I'm using SQLDependency to catch changes in my database. http://code.msdn.microsoft.com/How-to-use-SqlDependency-5c0da0b3 This code really works. When I'm changing something in table, event is fired. private void RefreshWithSqlDependency() …
dobermann
  • 47
  • 5
0
votes
1 answer

Can calling ToList on a DbSet cause caching?

I was using the following code to repopulate an ObservableCollection on change notification from a SqlDependency: var set = _dbContext.Set().ToList(); this.AddRange(set); In this scenario, the OnChange event fires correctly, but the list is…
ProfK
  • 49,207
  • 121
  • 399
  • 775
0
votes
2 answers

Why am I getting an 'open data reader' exception with my SqlDependency subscription?

I have finally, with an aggregate of an amazingly high numbers of dysfunctional examples, managed to receive change messages on a SqlDependency object. This knowledge may prepare you for the inelegance or plain incorrectness of my code. I have an…
ProfK
  • 49,207
  • 121
  • 399
  • 775
0
votes
1 answer

SQLDependency OnChangeEvent not firing

I have the following code to execute a SqlCommand against a database View: public IEnumerable GetData() { using (var connection = new…
CallumVass
  • 11,288
  • 26
  • 84
  • 154
0
votes
1 answer

Sql trigger to start and pass parameters to windows service

I have a working windows service that generates reports based on parameters. I need to start a windows service when a new row inserted into a table and pass some newly inserted values to service to generate report. How to accomplish this? Am pretty…
0
votes
1 answer

call clientside function after sqldependency change

I am using SqlDependency to monitor changes on a specific db table. I need to call a javascript event after the change event is triggered! any idea ? This code is in my asp.net page code behind public void StartTasksMonitor() { var…
James Dayeh
  • 516
  • 1
  • 5
  • 13
0
votes
2 answers

Production SqlSiteMapProvider issue - all the items 'disappeared'?

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…
dferraro
  • 6,357
  • 11
  • 46
  • 69
0
votes
0 answers

Render PartialView from background thread using SqlDependency

I'm trying to update a PartialView when a register is updated in DataBase. I'm using SqlDependency and the event rise properly when the change happens. SqlDependency.OnChange += new OnChangeEventHandler(sqlDependency_OnChange); Method: Private void…
Mario Levrero
  • 3,345
  • 4
  • 26
  • 57
0
votes
1 answer

Cache drop if query has WHERE Clause

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…