Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Insert-Change not firing #67

Open
Ottilie-Steinhauer opened this issue Apr 15, 2020 · 0 comments
Open

Insert-Change not firing #67

Ottilie-Steinhauer opened this issue Apr 15, 2020 · 0 comments

Comments

@Ottilie-Steinhauer
Copy link

Ottilie-Steinhauer commented Apr 15, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant