ServerEvents.SubscribeToEvents ServerEvents.SubscribeToEvents ServerEvents.SubscribeToEvents Method

Definition

Specifies the server events to receive.

Overloads

SubscribeToEvents(ServerEventSet) SubscribeToEvents(ServerEventSet) SubscribeToEvents(ServerEventSet)

Specifies the server events to receive.

SubscribeToEvents(ServerTraceEventSet) SubscribeToEvents(ServerTraceEventSet) SubscribeToEvents(ServerTraceEventSet)

Specifies the server trace events to receive.

SubscribeToEvents(ServerEventSet, ServerEventHandler) SubscribeToEvents(ServerEventSet, ServerEventHandler) SubscribeToEvents(ServerEventSet, ServerEventHandler)

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

SubscribeToEvents(ServerTraceEventSet, ServerEventHandler) SubscribeToEvents(ServerTraceEventSet, ServerEventHandler) SubscribeToEvents(ServerTraceEventSet, ServerEventHandler)

Specifies the server trace events to receive and the event handler that handles the events.

SubscribeToEvents(ServerEventSet) SubscribeToEvents(ServerEventSet) SubscribeToEvents(ServerEventSet)

Specifies the server events to receive.

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

A ServerEventSet 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 OnEvent statement.

SubscribeToEvents(ServerTraceEventSet) SubscribeToEvents(ServerTraceEventSet) SubscribeToEvents(ServerTraceEventSet)

Specifies the server trace events to receive.

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

A ServerTraceEventSet object that specifies the set of trace events to receive.

Examples

Handling SMO Events

Remarks

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

SubscribeToEvents(ServerEventSet, ServerEventHandler) SubscribeToEvents(ServerEventSet, ServerEventHandler) SubscribeToEvents(ServerEventSet, ServerEventHandler)

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

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

A ServerEventSet 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

SubscribeToEvents(ServerTraceEventSet, ServerEventHandler) SubscribeToEvents(ServerTraceEventSet, ServerEventHandler) SubscribeToEvents(ServerTraceEventSet, ServerEventHandler)

Specifies the server trace events to receive and the event handler that handles the events.

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

A ServerTraceEventSet 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