Hi,

I have a windows form application that is designed to monitor payments made within agreed timescales. Once a timescale has passed any payments that are outstanding will get assigned as arrears.

What I need to decide is the best way to handle the task that checks if the due date has passed and then updates the related tables.

I was simply using a timer control to figure out the time of day but realised that there is no garuantee that a user will run the program which would lead to the updates not happening. So i need a way to fire the event whether the user runs the app or not. The app will be deployed to run on a server when complete.

whats the correct way to approach this kind of problem?

Depending on the complexity of the task, I can think of 2 ways off the top of my head:

1) Write a C# process that does your check and updates the required tables (most likely a Windows Console application). Set it up to run on your server as a Windows Scheduled Task, in the interval you need to check.

2) Develop a database procedure (e.g., in SQL Server, a stored procedure) that does your check and update. Set up a scheduled database job that runs your procedure.

Hope this helps!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.