InstanceEnumeration Constructor
Creates an object of the InstanceEnumeration class.
Espace de noms: Microsoft.SqlServer.NotificationServices
Assembly: Microsoft.SqlServer.NotificationServices (in microsoft.sqlserver.notificationservices.dll)
Syntaxe
'Déclaration
Public Sub New
public InstanceEnumeration ()
public:
InstanceEnumeration ()
public InstanceEnumeration ()
public function InstanceEnumeration ()
Notes
The InstanceEnumeration constructor can be used in both managed and unmanaged code because it does not require any parameters.
Exemple
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")
Plateformes
Plateformes de développement
Pour obtenir la liste des plateformes prises en charge, consultez Configuration matérielle et logicielle requise pour l'installation de SQL Server 2005.
Plateformes cibles
Pour obtenir la liste des plateformes prises en charge, consultez Configuration matérielle et logicielle requise pour l'installation de SQL Server 2005.
Voir aussi
Référence
InstanceEnumeration Class
InstanceEnumeration Members
Microsoft.SqlServer.NotificationServices Namespace