Skip to content

Insert-Change not firing #67

@Ottilie-Steinhauer

Description

@Ottilie-Steinhauer

Hello,
I included the class SqlDependencyEx, the trigger creation and removal works very well, thank you.
Unfortunately, the change event is not recognized. When I look at the method ReceiveEvent(), reader.IsDBNull (0) = true in any case.
I use vb.net and add SqlDependencyEx with

 _SQLListener1 = New SqlDependencyEx(MySQLString, _ApplicationConfig.Config.ArchiveDatabaseName, "tbRezept")

AddHandler _SQLListener1.TableChanged, AddressOf Me.SQLDatabaseTableChanged
SQLListener1.Start()

The EventHandler actually does not very much,

Private Sub SQLDatabaseTableChanged(sender As Object, e As ServiceBrokerListener.Domain.SqlDependencyEx.TableChangedEventArgs) 'some Stuff like a counter to count how often the function was called End Sub

The database table has other triggers. Can that be the reason? Is the inserted table no longer available for the SQLDependenyEx after the first trigger has expired?

An additional question: Now I'm trying to modify SQL_FORMAT_CREATE_NOTIFICATION_TRIGGER.
There is the line
IF EXISTS (SELECT * FROM sys.services WHERE name = '{3}')

What is it necessary for? If I delete it, it seems that the code is working.

Ottilie

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions