共用方式為


ServerEvents.SubscribeToEvents 方法 (ServerTraceEventSet, ServerEventHandler)

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

命名空間:  Microsoft.SqlServer.Management.Smo
組件:  Microsoft.SqlServer.Smo (在 Microsoft.SqlServer.Smo.dll 中)

語法

'宣告
Public Sub SubscribeToEvents ( _
    events As ServerTraceEventSet, _
    eventHandler As ServerEventHandler _
)
'用途
Dim instance As ServerEvents 
Dim events As ServerTraceEventSet 
Dim eventHandler As ServerEventHandler

instance.SubscribeToEvents(events, eventHandler)
public void SubscribeToEvents(
    ServerTraceEventSet events,
    ServerEventHandler eventHandler
)
public:
void SubscribeToEvents(
    ServerTraceEventSet^ events, 
    ServerEventHandler^ eventHandler
)
member SubscribeToEvents : 
        events:ServerTraceEventSet * 
        eventHandler:ServerEventHandler -> unit
public function SubscribeToEvents(
    events : ServerTraceEventSet, 
    eventHandler : ServerEventHandler
)

參數

範例

處理 SMO 事件

請參閱

參考

ServerEvents 類別

SubscribeToEvents 多載

Microsoft.SqlServer.Management.Smo 命名空間