How do I track a repeating calendar event in C# / SQL Server? [closed] How do I track a repeating calendar event in C# / SQL Server? [closed] database database

How do I track a repeating calendar event in C# / SQL Server? [closed]


I did something like this before and I based my schema off of SQL Servers sysschedules table.

http://technet.microsoft.com/en-us/library/ms178644.aspx

The schema linked above will allow you to store the schedule for a job (event). Then you can calculate what dates the event occurs on based off of the schedule. This may be a lengthy calculation, so I would try to cache that result somewhere.


I think it depends on type of event it is. Is it like Christmas where once it comes along and happens you really aren't interested in it until the next occurrence? Or is it a task like, "Make sure I call my mom every month", where if it happens and you missed it you wouldn't want it to go away?

One way I recently implemented the latter was to have a record that had next_occurrence (date), reoccurence_period (weekly, monthly, yearly, etc) columns. So that as the next occurence approched it would show up in the list. Once it passed the list item would have a recycle icon that once pressed would update the record to the next future occurence.

Again, i'm not sure if this applies to your situation, but it worked well for mine.