Méthode Session.AddTarget (String)
Adds a new Target object to the session.
Espace de noms : Microsoft.SqlServer.Management.XEvent
Assembly : Microsoft.SqlServer.Management.XEvent (en Microsoft.SqlServer.Management.XEvent.dll)
Syntaxe
'Déclaration
Public Function AddTarget ( _
targetName As String _
) As Target
'Utilisation
Dim instance As Session
Dim targetName As String
Dim returnValue As Target
returnValue = instance.AddTarget(targetName)
public Target AddTarget(
string targetName
)
public:
Target^ AddTarget(
String^ targetName
)
member AddTarget :
targetName:string -> Target
public function AddTarget(
targetName : String
) : Target
Paramètres
- targetName
Type : System.String
A string value that contains the fully qualified name of the target.
Valeur de retour
Type : Microsoft.SqlServer.Management.XEvent.Target
The newly created Target object.
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | Parameter targetName is null |
XEventException | Target name is malformed or wrong. |