Partilhar via


EventClassCollection.Add Method

Adds an EventClass to the EventClassCollection.

Namespace: Microsoft.SqlServer.Management.Nmo
Assembly: Microsoft.SqlServer.Smo (in microsoft.sqlserver.smo.dll)

Syntax

'Declaration
Public Sub Add ( _
    eventClass As EventClass _
)
public void Add (
    EventClass eventClass
)
public:
void Add (
    EventClass^ eventClass
)
public void Add (
    EventClass eventClass
)
public function Add (
    eventClass : EventClass
)

Parameters

  • eventClass
    The EventClass to add to the collection.

Remarks

Each event class must have a unique name within the application.

If you add event classes to an application after deploying the application, you must Update the instance to apply the changes.

Example

The following examples show how to add an event class to an application:

myApplication.EventClasses.Add(flightEvents);
myApplication.EventClasses.Add(flightEvents)

Thread Safety

Any public static (Shared in Microsoft Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

For a list of the supported platforms, see Hardware and Software Requirements for Installing SQL Server 2005.

Target Platforms

For a list of the supported platforms, see Hardware and Software Requirements for Installing SQL Server 2005.

See Also

Reference

EventClassCollection Class
EventClassCollection Members
Microsoft.SqlServer.Management.Nmo Namespace

Other Resources

Defining Event Classes
EventClass Element (ADF)