SqlDependency.OnChange not firing in WinForm?

前端 未结 1 407
[愿得一人]
[愿得一人] 2021-01-25 03:52

I used Detecting Changes with SqlDependency as example for the code that I\'m writing. I\'ve also looked at other links with similar code, but none of them work.

Essent

1条回答
  •  清酒与你
    2021-01-25 04:42

    You are doing everything correctly except one thing. Call the method SomeMethod() once in your Form1 constructor.

    All subsequent changes to your table data will trigger the dependency change.

    0 讨论(0)
提交回复
热议问题