Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
string connectionString = Settings.Default.ConnString;
string listenQuery = @ & quot;
SELECT[Name] FROM[dbo].[Insurers] & quot;;
// Create instance of the DB Listener
DatabaseChangeListener changeListener = new DatabaseChangeListener(connectionString);
// Define what to do when changes were detected
changeListener.OnChange += () =>
{
ChatHub.SendMessages();
// Reattach listener event - DO NOT TOUCH!
changeListener.Start(listenQuery);
};
// Start listening for changes
changeListener.Start(listenQuery);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment