Compartir a través de


InstanceEnumeration Constructor

Creates an object of the InstanceEnumeration class.

Espacio de nombres: Microsoft.SqlServer.NotificationServices
Ensamblado: Microsoft.SqlServer.NotificationServices (in microsoft.sqlserver.notificationservices.dll)

Sintaxis

'Declaración
Public Sub New
public InstanceEnumeration ()
public:
InstanceEnumeration ()
public InstanceEnumeration ()
public function InstanceEnumeration ()

Notas

The InstanceEnumeration constructor can be used in both managed and unmanaged code because it does not require any parameters.

Ejemplo

The following examples show how to create and initialize an InstanceEnumeration object in managed code:

'Create an InstanceEnumeration object.
Dim myInstanceEnumeration As New InstanceEnumeration()

'Iterate through the instance descriptions.
Dim instanceDescription As NSInstanceDescription
For Each instanceDescription In myInstanceEnumeration
    Console.WriteLine("Instance Name: {0}", _
    instanceDescription.InstanceName)
Next instanceDescription
//InstanceEnumeration.GetEnumerator Method sample

//Create an InstanceEnumeration object.
InstanceEnumeration myInstanceEnumeration = 
    new InstanceEnumeration();

//Iterate through the instance descriptions.
foreach (NSInstanceDescription instanceDescription 
    in myInstanceEnumeration)
{
    Console.WriteLine("Instance Name: {0}", 
        instanceDescription.InstanceName);
}

The following example shows how to create an InstanceEnumeration object in unmanaged Microsoft Visual Basic Scripting Edition (VBScript) code:

'Create an InstanceEnumeration object.
set myInstanceEnumeration = WScript.CreateObject("Microsoft.SqlServer.NotificationServices.InstanceEnumeration")

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

InstanceEnumeration Class
InstanceEnumeration Members
Microsoft.SqlServer.NotificationServices Namespace