Click here to Skip to main content
15,867,997 members
Please Sign up or sign in to vote.
5.00/5 (2 votes)
See more:
I have a listView that I've binded to a MySQL dataSource but I can't seem to figure out how to have the listView automatically display the results when changes are made to the database table (update/insert) without the user having to fire an event i.e. button click, timer tick, etc...

Can someone please point me in the right direction. Any advice/solutions would be greatly appreciated!

Thanks,
-Donald
Posted

I could be wrong as it's been a long time since I've used MySQL, but mySQL does not support notifications. The only way to see a change in the database is to rerun the query at an interval and compare the differences between to the two datasets, or...

You database woujld have to timestamp each change to the database. Each client would get a timestamp when it queries the database. That timestamp is used by the next query to tell the database to "give me all the changes AFTER this timestamp".


Oh, SQL Server DOES support notifications. Google for "SQL Server Notification Service".
 
Share this answer
 
v2
Hi,
You Can Use Sql cache dependency here .....

1)you have to store data in cache and give to list-box..
2)when database changes cache get updated.....
 
Share this answer
 
Comments
d.allen101 14-Oct-11 14:32pm    
not sure if you got my 'thanks' but wanted to make sure. thanks once again Tushar, you've helped me tremendously.
Thanks Tushar! I wasn't aware of 'cache dependency'! I've been pooling the database with a threadTimer for months now. Using cache dependency is exactly what I've been looking for.

Thanks again!
 
Share this answer
 
Comments
André Kraak 12-Oct-11 9:37am    
If you have a question about or comment on a given solution use the "Have a Question or Comment?" option beneath the solution. When using this option the person who gave the solution gets an e-mail message and knows you placed a comment and can respond if he/she wants.

Please move the content of this solution to the solution you are commenting on and remove the solution.
Thank you.
d.allen101 14-Oct-11 14:30pm    
Thanks Andre I wasn't aware.

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