Last post Jun 29, 2015 11:38 PM by Krunal Parekh
Jun 29, 2015 06:31 AM|Eng-Mondy|LINK
Hello. I am working on MVC application with SignalR.
Actually i worked on this
example using SQL Dependency by enabling SQL Broker service. But my problem i would like to receive only SQL messages on specific field change/updated value on specific table.
- For example : If the user comment is approved from the admin control panel, The user receives the SQL notification about the comment is published.
That is only a SQL flag change from ( Approved comment : bool value 0 || 1) , So how can i implement that.
Jun 29, 2015 11:38 PM|Krunal Parekh|LINK
As far as I know you are not able to get just the changed records you will need to fire the query again.
As a workaround you could as described in the above thread use a flag in the database that will show you the modified data and when you fetch the records ONchange before subscribing again set the flag to not modified. So initially when SignalR is started
get all the records and in On Change just fetch records with flag modified now before subscribing again set the flag to not modified again so you don't get same records again and it does not fire multiple times. Now when you update any records in SQL with
the update set flag modified true.
Hope this helps.