Compartir a través de


HostedEventProvider.StartTime Property

Gets or sets a time of day used to calculate each of the invocation times for the hosted event provider.

Espacio de nombres: Microsoft.SqlServer.Management.Nmo
Ensamblado: Microsoft.SqlServer.Smo (in microsoft.sqlserver.smo.dll)

Sintaxis

'Declaración
Public Property StartTime As DateTime
public DateTime StartTime { get; set; }
public:
property DateTime StartTime {
    DateTime get ();
    void set (DateTime value);
}
/** @property */
public DateTime get_StartTime ()

/** @property */
public void set_StartTime (DateTime value)
public function get StartTime () : DateTime

public function set StartTime (value : DateTime)

Valor de propiedad

A DateTime object that specifies the event provider start time.

Notas

The StartTime value must be specified in UTC.

If you do not provide a StartTime value, Notification Services runs the event provider for the first time when the instance starts or when you enable the event provider.

If you do provide a StartTime value, Notification Services runs the provider as follows:

  • Notification Services calculates the invocation times for the 24-hour period starting at the StartTime value.

  • Notification Services first invokes the event provider at the next calculated invocation time.

To remove a start time value, set the value to DateTime.MinValue. Notification Services uses the value to set the StartTime to NULL when you update the application.

The table shows examples of invocation schedules given various StartTime and Interval values.

Schedule

Values and Description

Every hour on the half hour

StartTime time value is 1:30 (or any other half hour).

Interval value is PT1H.

The event provider first runs at the next half-hour, such as 0:30, 1:30, 2:30, and so on, up to 23:30).

Every 3 hours on the hour starting at 1:00

StartTime time value is 1:00.

Interval value is PT3H.

The event provider first runs at the next 3-hour interval in the following list: 1:00, 4:00, 7:00, 10:00, 13:00, 16:00, 19:00, 22:00.

Every 6 hours starting at 12:00

StartTime time value is 12:00.

Interval value is PT6H.

The event provider first runs at the next 6-hour interval in the following list: 0:00, 6:00, 12:00, 18:00.

At 4:00 each day

StartTime time value is 4:00.

Interval value is PT24H.

The event provider runs at 4:00 each day regardless of what time it is started.

Ejemplo

The following example shows how define a hosted event provider with no start time. This event provider runs as soon as the event provider host starts.

// Define a hosted event provider and set properties.
HostedEventProvider flightEventProvider = new HostedEventProvider();
flightEventProvider.Parent = myApplication;
flightEventProvider.Name = "FlightEP";
flightEventProvider.StartTime = DateTime.MinValue;
flightEventProvider.Timeout = new TimeSpan(0, 5, 0);
flightEventProvider.ClassName = "FileSystemWatcherProvider";
flightEventProvider.AssemblyName = "";
flightEventProvider.SystemName = notificationServicesHost;
' Define a hosted event provider and set properties.
Dim flightEventProvider As HostedEventProvider = _
    New HostedEventProvider()
flightEventProvider.Parent = myApplication
flightEventProvider.Name = "FlightEP"
flightEventProvider.StartTime = DateTime.MinValue
flightEventProvider.Timeout = New TimeSpan(0, 5, 0)
flightEventProvider.ClassName = "FileSystemWatcherProvider"
flightEventProvider.AssemblyName = ""
flightEventProvider.SystemName = notificationServicesHost

Seguridad para subprocesos

Any public static (Shared in Microsoft Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Plataformas

Plataformas de desarrollo

Para obtener una lista de las plataformas compatibles, vea Requisitos de hardware y software para instalar SQL Server 2005.

Plataformas de destino

Para obtener una lista de las plataformas compatibles, vea Requisitos de hardware y software para instalar SQL Server 2005.

Vea también

Referencia

HostedEventProvider Class
HostedEventProvider Members
Microsoft.SqlServer.Management.Nmo Namespace

Otros recursos

Definir proveedores de eventos alojados
StartTime Element for HostedProvider/Schedule (ADF)