Поделиться через


InstanceEnumeration Constructor

Creates an object of the InstanceEnumeration class.

Пространство имен: Microsoft.SqlServer.NotificationServices
Сборка: Microsoft.SqlServer.NotificationServices (in microsoft.sqlserver.notificationservices.dll)

Синтаксис

'Декларация
Public Sub New
public InstanceEnumeration ()
public:
InstanceEnumeration ()
public InstanceEnumeration ()
public function InstanceEnumeration ()

Замечания

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

Пример

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")

Платформы

Платформы разработки

Список поддерживаемых платформ см. в разделе Hardware and Software Requirements for Installing SQL Server 2005.

Целевые платформы

Список поддерживаемых платформ см. в разделе Hardware and Software Requirements for Installing SQL Server 2005.

См. также

Справочник

InstanceEnumeration Class
InstanceEnumeration Members
Microsoft.SqlServer.NotificationServices Namespace