the simplest way to do something periodically is to use a timer - drag a timer from the toolbox onto your form. Set the interval and enable the timer either in the property window or in code like this:
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Timer1.Interval = 600000 Timer1.Enabled = True End Sub Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Timer1.Tick If FindAnomalies() = True Then UpdateDatabase() End If End Sub
Every 600000 milliseconds (10 minutes), the Tick event will fire and you can do your checking and/or updating.
One drawback of doing things this way is that, if the checking and updating takes a fair bit of work, it will interfere with the smooth running of your program. This is because the timer runs in the same thread as the form. The only way to get around this is to do this work on another thread. If you're not too familliar with working with threads, it might be better to avoid this as things can get very complicated very quickly. If you want to explore this further, you can drag a BackgroundWorker onto your form and get it to do the work every time your timer ticks, but only do this if it absolutely essential and you are prepared to do a lot more work. Good luck.
thank you so much for you reply and help
Hi when I tried to insert my output the void displayed null or 0 can you tell me what's wrong with my rpogram? tnx
My main program
int choice; public static void main(String args) Scanner absorb = new Scanner(System.in); // phase 1 login cloth cl = new ...
i am trying to create a library management system which is supposed to be used to store/keep infp for the library and the library members( book title, author, name and picture for borrower and other stuffs). The app has 6 buttons, delete, save, add,previsous,next, and upload( for upload ...
Im trying to bind my custom vertical scrollbar to datagridview is this possible.. Please help Thnak you..