Question

I'm attempting to create my first "real" C# application - a small pet project to help schedule peer reviews at work.

Due to the insane amount of process/bureaucracy involved in implementing anything new - as well as the fact that I'm doing this away from managements eyes, on my own time, for the time being - I'm going to be writing this with an MS Access MS Jet Engine backend (i.e. an access mdb file) due to restrictions on how I can deploy this application to my co-workers.

My question is: how do I poll the database intermittently to grab updates (new requested reviews, messages from other developers requesting info, etc.) from the database?

Should I just drop a Timer on each form that needs the info and refresh everything when an update has occurred?

Edit:
I'm looking for advice specifically on how to implement the timer. I can't install things on workstations, I don't have access to servers (outside of storage space), and I can't host this myself due to the company's security requirements since our client has ridiculous DoD restrictions.

I guess I've figured this out anyway, since the "timer on form" solution works just fine (I don't know what I was thinking when I said I wanted a secondary solution for a CLI version as it clearly isn't needed.. it's very late).

Thanks!

Was it helpful?

Solution

You could start a background worker thread to do the refreshes in an infinite loop, and sleep at the end (or beginning) of each loop iteration.

OTHER TIPS

develop your application as a aspnet MVC app. this way it's a web site and developers can simply refresh pages to get the latest results. this will help you in many ways: no polling, no access, web interface (very handy), [too many to mention]

start here - http://www.asp.net/learn/mvc-videos/video-395.aspx
EDIT: more links:
(these are great vids)
* http://www.asp.net/learn/mvc-videos/video-396.aspx
* http://www.asp.net/learn/mvc-videos/video-360.aspx
* http://www.asp.net/learn/mvc-videos/video-361.aspx

orrite.. i'll crumble.

my best suggestion to poll the access data store would be to use a System.IO.FileSystemWatcher to monitor the folder where the mdb file lives. this way you can craft your code to poll at an interval but only when the Changed event fires. this should chew less cpu and disk access.

hope this helps. :D

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top