Bind database field to textbox and show changes

CumulusGranitus
CumulusGranitus used Ask the Experts™
on
I want to display the value of a field in SQL Server database table in a textbox on a form only if the value changes. Periodically reading the table and updating the textbox if the value has changes is not an solution because i have hundreds of textboxes on the form and only some may change every second.

The SQL query may be of the form "SELECT TOP 1 Value FROM tblQA WHERE Key='ExampleKey001'".
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Sr. Software Engineer / Architect
Commented:
I would take a look at the SqlDependency class to see if that can help.

https://docs.microsoft.com/en-us/dotnet/api/system.data.sqlclient.sqldependency

Author

Commented:
I tried SqlDependency  some years ago in a small test program but it was not satisfactory. I will look again where the problems are. Thanks for the hint.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial