Click here to Skip to main content
14,937,943 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am Developing Windows Application Which Contain datagridView. when data is inserted into MS SQL Database then i want to display it into DataGridView. Now I am Using Timer which Ping Database (Open DB Connection,Execute Query,if data Found then Change datasource of DataGridView). is Any Another Method which Run when Data inserted into Table(No Need To Ping DB) Can I Use Windows Services
Posted

1 solution

Rather than using a timer construct some thing using the Observer pattern (also known as publish/subscribe)

This CP article is a good starting point Using SqlDependency for data change events[^] but there are others (now that you know to search for "Observer" or "Publish Subscribe" it should be easier to find something)
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900