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
4
votes
1 answer

Tracking table changes in ASP.NET core 2 and EF

I am working on integrations so I am building an api in .NET Core 2 and Entity Framework 7 for a system that was built in ASP.NET MVC 5 and EF 6 to communicate with other API's. Here is an image of what it looks like I would like my asp.net core 2…
Train
  • 3,420
  • 2
  • 29
  • 59
4
votes
1 answer

SqlDependency doesn't fire OnChange event when dataset is changed

I'm new to the concept of query notifications with SQL Server and it's going to take some time for me to wrap my head around it. My objective is to create a Windows service application that is notified when a change has been made to a SQL Server…
psyoptica
  • 57
  • 1
  • 9
4
votes
1 answer

SqlDependency / Service Broker in LocalDB, implementing Signal R

I am implementing SignalR in my project and wanting a real time notification in my client when something is change in my database. I have 3 components in my project Database Web API Service WPF Client I have my code written to enable my (2) Web…
4
votes
1 answer

Refresh page on database changes

Following this tutorial I was able to make an index view refresh itself when the corresponding table on the database changes. The problem occurs when I want to detect changes on a page with an index view that displays data from other tables,…
Lorena
  • 135
  • 8
4
votes
1 answer

SQlDependency Get only updated rows from database

I would like to get only updated rows from database using SignalR and SQLDependency. The status column of a table can be updated from multiple applications. What I need is that when this status column gets updated, I need my application to get that…
Yoky
  • 832
  • 10
  • 20
4
votes
2 answers

SqlDependency.OnChange is not firing with filter on datetime column

I am having issue using this SQL statement in SqlDependency. It simply not activating the SqlDependency.OnChange event, however returning the results as expected on SQL Server Query window. SELECT [Order].OrderId FROM [dbo].[Order] WHERE…
Khadim Ali
  • 2,548
  • 3
  • 33
  • 61
4
votes
4 answers

SqlDependency OnChange Event Fires many times for every single event on Database

I'm developing a notification system using SqlDependency and signalR, the problem I can't deal with is when I change the attribute value "IsOnline" in DB to True or False based on attendee status, OnChange event fires many times, first time a new…
AQADDOUMI
  • 49
  • 1
  • 2
  • 5
4
votes
2 answers

SignalR duplicate messages on sqlDependency change

I have developed a webpage that connects to the signalR hub hooking into the jquery code with angularjs. The clients are sent a message when a sqldependency.onchange event occurs, however, for every client connected the message is duplicated to…
JS1986
  • 1,920
  • 4
  • 29
  • 50
4
votes
1 answer

does SqlDependency lock table?

I want to use SqlDependency in my project, but the table that I want dependency is being used by several programs for very important purposes. So they have to be able to insert this table while SqlDependency in action. Is that possible? I've read…
Hasan Akgün
  • 467
  • 1
  • 4
  • 15
4
votes
1 answer

How to use SqlDependency in asp.net project

i like to know how anyone can work SqlDependency in web project. i got one code from stackoverflow like Asp.Net Signal R - Detect Changes in Database ? Asp.net Web Forms //Set up dependency protected void Application_Start() { //... …
Thomas
  • 33,544
  • 126
  • 357
  • 626
4
votes
1 answer

SQL Dependency causing errors in SQL Server

We have a C# web application that is using SQL dependency to expire cached query data. Although everything is working okay we are seeing a lot of errors being generated particularly in our production environment. The first error messages is…
Mant101
  • 2,705
  • 1
  • 23
  • 27
4
votes
2 answers

SqlDependency subscription not working when using IsolationLevel.ReadUncommitted in (unrelated?) Transaction

I've managed to get SqlDependency working, but only as long as I do not use IsolationLevel.ReadUncommited in what I thought was a SQL transaction unrelated to the SqlDependency. When I use IsolationLevel.ReadUncommitted in the transaction (heavily…
David Murdoch
  • 87,823
  • 39
  • 148
  • 191
4
votes
2 answers

SQL Server Notifications - My OnChange does not fire

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…
Nick
  • 19,198
  • 51
  • 185
  • 312
4
votes
2 answers

SqlDependency subscription not dropped from dm_qn_subscriptions on shutdown

My SqlDependency works fine, and the Broker Queue and Service get dropped properly when the application exits (I do execute SqlDependency.Stop(...) as recommended before terminating the process), yet I notice that the notification subscription…
4
votes
1 answer

Implementing QUOTED_IDENTIFIER globally

I've implemented a mechanism with the help of SqlDependency that alerts me of any changes in a particular database table. But this breaks my existing functionality where I'm updating the database table on which I've implemented SqlDependency. I'm…