Compartir a través de


NotificationServices.Instances Property

Gets the collection of Notification Services instances on the server.

Espacio de nombres: Microsoft.SqlServer.Management.Nmo
Ensamblado: Microsoft.SqlServer.Smo (in microsoft.sqlserver.smo.dll)

Sintaxis

'Declaración
Public ReadOnly Property Instances As InstanceCollection
public InstanceCollection Instances { get; }
public:
property InstanceCollection^ Instances {
    InstanceCollection^ get ();
}
/** @property */
public InstanceCollection get_Instances ()
public function get Instances () : InstanceCollection

Valor de propiedad

An InstanceCollection object representing the collection of Notification Services instances on the server. Use the Create method to compile an instance of Notification Services and create the Notification Services instance and application database objects. Use the Repair method to repair instance metadata in the msdb system database. Notification Services uses this data to enumerate instances.

Notas

The following examples show how to use the Instances property to get information about instances of Notification Services:

// Specify the Database Engine instance that hosts the 
// Notificaiton Services instance and get a reference to 
// the NotificationServices object.
smo.Server server = new smo.Server("MyServer");
nmo.NotificationServices notificationServices = server.NotificationServices;

// Get the Notification Services instance.
nmo.Instance nsinst = notificationServices.Instances ["Tutorial"];

// Get the instance's collection of delivery channels.
nmo.DeliveryChannelCollection dcCollection = nsinst.DeliveryChannels;

// Enumerate the delivery channels.
foreach (nmo.DeliveryChannel dc in dcCollection)
{
    Console.WriteLine(dc.Name);
}
' Specify the Database Engine instance that hosts the 
' Notificaiton Services instance and get a reference to 
' the NotificationServices object.
Dim server As New smo.Server("nsuetest")
Dim notificationServices As nmo.NotificationServices = _
    server.NotificationServices

' Get the Notification Services instance.
Dim nsinst As nmo.Instance = _
    notificationServices.Instances("Tutorial")

' Get the instance's collection of delivery channels.
Dim dcCollection As nmo.DeliveryChannelCollection = _
    nsinst.DeliveryChannels

' Enumerate the delivery channels.
Dim dc As nmo.DeliveryChannel
For Each dc In dcCollection
    Console.WriteLine(dc.Name)
Next

Seguridad para subprocesos

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.

Plataformas

Plataformas de desarrollo

Para obtener una lista de las plataformas compatibles, vea Requisitos de hardware y software para instalar SQL Server 2005.

Plataformas de destino

Para obtener una lista de las plataformas compatibles, vea Requisitos de hardware y software para instalar SQL Server 2005.

Vea también

Referencia

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