Adds a new Event object to the session from fully qualified event name.
命名空間: Microsoft.SqlServer.Management.XEvent
組件: Microsoft.SqlServer.Management.XEvent (在 Microsoft.SqlServer.Management.XEvent.dll 中)
語法
'宣告
Public Function AddEvent ( _
eventName As String _
) As Event
'用途
Dim instance As Session
Dim eventName As String
Dim returnValue As Event
returnValue = instance.AddEvent(eventName)
public Event AddEvent(
string eventName
)
public:
Event^ AddEvent(
String^ eventName
)
member AddEvent :
eventName:string -> Event
public function AddEvent(
eventName : String
) : Event
參數
- eventName
型別:System.String
A string value that contains the fully qualified name of the event.
傳回值
型別:Microsoft.SqlServer.Management.XEvent.Event
The newly created Event object.
例外狀況
| 例外狀況 | 條件 |
|---|---|
| ArgumentNullException | Parameter eventName is null |
| XEventException | Event name is malformed or wrong. |