You need to schedule a timer job to run every two hours.
Which schedule should you use?
A.
SPDailySchedule
B.
SPHourlySchedule
C.
SPMinuteSchedule
D.
SPOneTimeSchedule
Explanation:
MNEMONIC RULE: “SPMinuteSchedule”SPMinuteSchedule object has Interval property that allows set the interval of the schedule to 120 minutes (2 hours).
SPHourlySchedule object does not have Interval property, so it can only run a job every hour.
SPMinuteSchedule Members
http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spminuteschedule_members.aspxSPHourlySchedule Members
http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.sphourlyschedule_members.aspx
This is not allowed : values greater than 59 throw an exception
public int Interval
{
get
{
return this.m_lMinuteInterval;
}
set
{
if (value 59)
{
throw new System.ArgumentOutOfRangeException(“value”);
}
this.m_lMinuteInterval = value;
}
}