SPJobDefinition.Schedule property
Gets or sets the schedule of the job definition.
Namespace: Microsoft.SharePoint.Administration
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Syntax
'Declaration
Public Property Schedule As SPSchedule
Get
Set
'Usage
Dim instance As SPJobDefinition
Dim value As SPSchedule
value = instance.Schedule
instance.Schedule = value
public SPSchedule Schedule { get; set; }
Property value
Type: Microsoft.SharePoint.SPSchedule
An SPSchedule object.
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | The value that you attempted to set is a null reference (Nothing in Visual Basic). |
ArgumentOutOfRangeException | The DateTime structure in the Time property of an SPOneTimeSchedule object specifies a year prior to 1900. |
SPException | You are attempting to convert a one-time job to a recurring job, or a recurring job to a one-time job. |
Remarks
If you want the job to run immediately, call the RunNow() method.