NotificationServices Class
Represents a Notification Services server.
Espacio de nombres: Microsoft.SqlServer.Management.Nmo
Ensamblado: Microsoft.SqlServer.Smo (in microsoft.sqlserver.smo.dll)
Sintaxis
'Declaración
Public NotInheritable Class NotificationServices
Inherits NamedSmoObject
public sealed class NotificationServices : NamedSmoObject
public ref class NotificationServices sealed : public NamedSmoObject
public final class NotificationServices extends NamedSmoObject
public final class NotificationServices extends NamedSmoObject
Notas
Texto actualizado:14 de abril de 2006
Use the NotificationServices class to enumerate the Notification Services instances on an instance of the SQL Server 2005 Database Engine (Motor de base de datos).
If you attempt to enumerate instances on a SQL Server 2000 instance, Notification Services throws an exception.
When using SQL Server Authentication to connect to a Notification Services instance via Notification Services Management Objects (NMO), you use a Server object to obtain a NotificationServices reference, and then use this reference to get a Notification Services instance. When creating an instance of the Server object, you can specify a ServerConnection object that uses a SqlConnection object.
If you are using SQL Server Authentication to call instance and application management methods such as Create, Update, Drop, Enable, or Disable, the SqlConnection must not already be open.
Make sure the SqlConnection is not opened before the Server object instance is created, or else use another ServerConnection constructor that does not use a SqlConnection object.
Inheritance Hierarchy
System.Object
Microsoft.SqlServer.Management.Smo.SmoObjectBase
Microsoft.SqlServer.Management.Smo.SqlSmoObject
Microsoft.SqlServer.Management.Smo.NamedSmoObject
Microsoft.SqlServer.Management.Nmo.NotificationServices
Ejemplo
The following examples show how to use the Notification Services class 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 Members
Microsoft.SqlServer.Management.Nmo Namespace
Server