ServerRoleEvents.SubscribeToEvents ServerRoleEvents.SubscribeToEvents ServerRoleEvents.SubscribeToEvents Method

Definition

Specifies the sequence events to receive.

Overloads

SubscribeToEvents(ObjectEventSet) SubscribeToEvents(ObjectEventSet) SubscribeToEvents(ObjectEventSet)

Specifies the ServerRole events to receive.

SubscribeToEvents(ObjectEventSet, ServerEventHandler) SubscribeToEvents(ObjectEventSet, ServerEventHandler) SubscribeToEvents(ObjectEventSet, ServerEventHandler)

Specifies the ServerRole events to receive and the event handler that handles the events.

SubscribeToEvents(ObjectEventSet) SubscribeToEvents(ObjectEventSet) SubscribeToEvents(ObjectEventSet)

Specifies the ServerRole events to receive.

public:
 void SubscribeToEvents(Microsoft::SqlServer::Management::Smo::ObjectEventSet ^ events);
public void SubscribeToEvents (Microsoft.SqlServer.Management.Smo.ObjectEventSet events);
Public Sub SubscribeToEvents (events As ObjectEventSet)
Parameters
events
ObjectEventSet ObjectEventSet ObjectEventSet

A ObjectEventSet object that specifies the set of events to receive.

Examples

Handling SMO Events

Remarks

Events are sent to the event handlers that are registered with the ServerEvent event.

SubscribeToEvents(ObjectEventSet, ServerEventHandler) SubscribeToEvents(ObjectEventSet, ServerEventHandler) SubscribeToEvents(ObjectEventSet, ServerEventHandler)

Specifies the ServerRole events to receive and the event handler that handles the events.

public:
 void SubscribeToEvents(Microsoft::SqlServer::Management::Smo::ObjectEventSet ^ events, Microsoft::SqlServer::Management::Smo::ServerEventHandler ^ eventHandler);
public void SubscribeToEvents (Microsoft.SqlServer.Management.Smo.ObjectEventSet events, Microsoft.SqlServer.Management.Smo.ServerEventHandler eventHandler);
Public Sub SubscribeToEvents (events As ObjectEventSet, eventHandler As ServerEventHandler)
Parameters
events
ObjectEventSet ObjectEventSet ObjectEventSet

A ObjectEventSet object that specifies the set of events to receive.

eventHandler
ServerEventHandler ServerEventHandler ServerEventHandler

A ServerEventHandler object that handles the events that are received.

Examples

Handling SMO Events

Applies to