如何跟踪C#/ SQL Server中的重复日历事件? [英] How do I track a repeating calendar event in C# / SQL Server?

查看:227
本文介绍了如何跟踪C#/ SQL Server中的重复日历事件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在应用程式的日期/时间显示中显示重复的活动。此日期时间显示可以采用日历的形式,但它也可以是即将到来的事件的列表。

I'd like to display a repeating event on a date/time display in an app. This date time display can take the form of a calendar, but it could also just be a list of upcoming events.

处理跟踪此事件可以重复的最佳方法是什么?

例如:事件是否应存储在数据库中,并在显示代码中多次投影/重复?如果事件存储多次,然后只是呈现?

推荐答案

我的模式关闭SQL Server sysschedules表。

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.

这篇关于如何跟踪C#/ SQL Server中的重复日历事件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆