HostedEventProvider Class

Represents a hosted event provider for a Notification ServicesApplication.

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

public sealed class HostedEventProvider : NamedSmoObject
public final class HostedEventProvider extends NamedSmoObject
public final class HostedEventProvider extends NamedSmoObject

Event providers collect event data and submit it to an event class. Each collected event is persisted as a single row in the event class table in the application database.

Hosted event providers are run by the Notification Services engine. Notification Services has three built-in hosted event providers. You can also use custom hosted event providers.

Hosted event providers are optional. If you do not use hosted event providers, you can use non-hosted event providers or the event submission stored procedures.

For more information, see Defining Event Providers.

The following examples show how to define a hosted event provider:

// Define a hosted event provider
HostedEventProvider flightEventProvider = 
    new HostedEventProvider(myApplication, "FlightEP");
flightEventProvider.ClassName = "FileSystemWatcherProvider";
flightEventProvider.SystemName = notificationServicesHost;

// Define event provider arguments
HostedEventProviderArgument fileArg_Directory = 
    new HostedEventProviderArgument(
    flightEventProvider, "WatchDirectory");
fileArg_Directory.Value = sampleDirectory + @"\Events";

HostedEventProviderArgument fileArg_Schema = 
    new HostedEventProviderArgument(
    flightEventProvider, "SchemaFile");
fileArg_Schema.Value = sampleDirectory + 

HostedEventProviderArgument fileArg_EventClass = 
    new HostedEventProviderArgument(flightEventProvider, 
fileArg_EventClass.Value = "FlightEvents";


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.

Development Platforms

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

Target Platforms

Community Additions