Freigeben über


ServerInstanceCollection-Klasse

The ServerInstanceCollection class represents a collection of ServerInstance objects that represent all the instances of SQL Server defined on the parent object.

Vererbungshierarchie

System.Object
  Microsoft.SqlServer.Management.Smo.Wmi.WmiCollectionBase
    Microsoft.SqlServer.Management.Smo.Wmi.ServerInstanceCollection

Namespace:  Microsoft.SqlServer.Management.Smo.Wmi
Assembly:  Microsoft.SqlServer.SqlWmiManagement (in Microsoft.SqlServer.SqlWmiManagement.dll)

Syntax

'Declaration
Public NotInheritable Class ServerInstanceCollection _
    Inherits WmiCollectionBase _
    Implements ICollection, IEnumerable
'Usage
Dim instance As ServerInstanceCollection
public sealed class ServerInstanceCollection : WmiCollectionBase, 
    ICollection, IEnumerable
public ref class ServerInstanceCollection sealed : public WmiCollectionBase, 
    ICollection, IEnumerable
[<SealedAttribute>]
type ServerInstanceCollection =  
    class 
        inherit WmiCollectionBase 
        interface ICollection 
        interface IEnumerable 
    end
public final class ServerInstanceCollection extends WmiCollectionBase implements ICollection, IEnumerable

Der ServerInstanceCollection-Typ macht folgende Elemente verfügbar.

Eigenschaften

  Name Beschreibung
Öffentliche Eigenschaft Count Gets the number of ServerInstance objects in the referenced collection.
Öffentliche Eigenschaft IsSynchronized Gets the Boolean property value that specifies whether access to the collection is synchronized (thread safe). (Geerbt von WmiCollectionBase.)
Öffentliche Eigenschaft Item[Int32] Gets a ServerInstance object in the collection by index number.
Öffentliche Eigenschaft Item[String] Gets a ServerInstance object in the collection by name.
Öffentliche Eigenschaft Parent Gets the ManagedComputer object that is the parent of the ServerInstanceCollection object.
Öffentliche Eigenschaft SyncRoot Gets an object that can be used to synchronize access to the collection. (Geerbt von WmiCollectionBase.)

Zum Anfang

Methoden

  Name Beschreibung
Öffentliche Methode Contains Checks whether the specified key value exists in the collection.
Öffentliche Methode CopyTo Copies the collection objects to a one-dimensional array beginning at the index value specified.
Öffentliche Methode Equals (Geerbt von Object.)
Öffentliche Methode GetEnumerator Returns an IEnumerator interface that allows you to iterate through the objects in the collection.
Öffentliche Methode GetHashCode (Geerbt von Object.)
Öffentliche Methode GetType (Geerbt von Object.)
Öffentliche Methode ToString (Geerbt von Object.)

Zum Anfang

Felder

  Name Beschreibung
Geschütztes Feld initialized Defines a boolean method that initializes the collection of objects in the Windows Management Instrumentation (WMI) object preference. Verweisen Sie nicht direkt im Code auf dieses Element. Unterstützt die SQL Server-Infrastruktur. (Geerbt von WmiCollectionBase.)
Geschütztes Feld innerColl Nur für Informationszwecke identifiziert. Nicht unterstützt. Zukünftige Kompatibilität wird nicht sichergestellt. (Geerbt von WmiCollectionBase.)

Zum Anfang

Explizite Schnittstellenimplementierungen

  Name Beschreibung
Explizite SchnittstellenimplementierungPrivate Methode ICollection.CopyTo Copies the collection objects to a one-dimensional array beginning at the index value specified.

Zum Anfang

Hinweise

A ServerInstanceCollection object can be used to gain access to a set of instances of SQL Server. You can use the Item property to return a specific ServerInstance object.

Thread Safety

Alle öffentlichen, statischen Elemente dieses Typs (Shared in Microsoft Visual Basic) sind für Vorgänge mit mehreren Threads sicher. Bei Instanzmembern ist die Threadsicherheit nicht gewährleistet.

Threadsicherheit

Alle öffentlichen static (Shared in Visual Basic)-Elemente dieses Typs sind Threadsicher. Für Instanzelemente wird die Threadsicherheit nicht gewährleistet.

Siehe auch

Verweis

Microsoft.SqlServer.Management.Smo.Wmi-Namespace