Partilhar via


NonHostedEventProvider Constructor (Application, String)

Initializes a new instance of the NonHostedEventProvider class with the parent application and a name.

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

Syntax

'Declaration
Public Sub New ( _
    application As Application, _
    name As String _
)
public NonHostedEventProvider (
    Application application,
    string name
)
public:
NonHostedEventProvider (
    Application^ application, 
    String^ name
)
public NonHostedEventProvider (
    Application application, 
    String name
)
public function NonHostedEventProvider (
    application : Application, 
    name : String
)

Parameters

  • name
    A String, between 1 and 255 characters in length, that specifies the name of the NonHostedEventProvider. The name must be unique within the application.

    You cannot change the name. To rename a non-hosted event provider, remove the non-hosted event provider and then create a new one.

Example

The following examples show how to define a non-hosted event provider and add it to the collection of non-hosted event providers for the application:

// Define non-hosted event provider
NonHostedEventProvider nhep = 
    new NonHostedEventProvider(myApplication, "MyNonHostedEP");
myApplication.NonHostedEventProviders.Add(nhep);
' Define non-hosted event provider
Dim nhep As NonHostedEventProvider = _
    New NonHostedEventProvider(myApplication, "MyNonHostedEP")
myApplication.NonHostedEventProviders.Add(nhep)

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

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

Other Resources

Defining Non-Hosted Event Providers
NonHostedProvider Element (ADF)
ProviderName Element for NonHostedProvider (ADF)