Click here to Skip to main content
15,886,137 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello everyone and thanks for your help in advance. I am wokring on a SignalR application. Within the hub, I have the following code:

VB
Private Sub dependency_OnChange(sender As Object, e As SqlNotificationEventArgs)
        Dim nHub As New NotificationHub()
        nHub.SendNotifications()
    End Sub
This works but fires multiple multiple times for any single record operation.  I then tried:

    Private Sub dependency_OnChange(sender As Object, e As SqlNotificationEventArgs)
        If e.Type = SqlNotificationType.Change Then
            Dim nHub As New NotificationHub()
            nHub.SendNotifications()
        End If
    End Sub

However, this causes no notification to be issued. Upon checking, I found the e.Type was equal to "Subscribe". I then changed the code to utilize SqlNotificationInfo:
VB
If e.Info = SqlNotificationInfo.Insert _
Or e.Info = SqlNotificationInfo.Delete _
Or e.Info = SqlNotificationInfo.Update Then
         Dim nHub As New NotificationHub()
         nHub.SendNotifications()
End If

However, this doesn't fire either. I'm not really sure where to go next. Any help would be greatly appreciated.
Posted
Updated 27-Feb-15 1:16am
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900