Примечание.
Для доступа к этой странице требуется авторизация. Вы можете попробовать войти или изменить каталоги.
Для доступа к этой странице требуется авторизация. Вы можете попробовать изменить каталоги.
Enumerates a list of local available instances of Microsoft SQL Server.
Пространство имен: Microsoft.SqlServer.Management.Smo
Сборка: Microsoft.SqlServer.Smo (in microsoft.sqlserver.smo.dll)
Синтаксис
'Декларация
Public Shared Function EnumAvailableSqlServers ( _
localOnly As Boolean _
) As DataTable
public static DataTable EnumAvailableSqlServers (
bool localOnly
)
public:
static DataTable^ EnumAvailableSqlServers (
bool localOnly
)
public static DataTable EnumAvailableSqlServers (
boolean localOnly
)
public static function EnumAvailableSqlServers (
localOnly : boolean
) : DataTable
Параметры
localOnly
A Boolean value that specifies whether local instances are listed or all instances available on the network.If True, only local instances are listed.
If False, all instances are listed.
Возвращаемое значение
A DataTable system object value that contains an enumerated list of information about the available instances of SQL Server. The table describes the different columns of the returned DataTable.
Column |
Data type |
Description |
Name |
The name of the instance of SQL Server. |
|
Server |
String |
The name of the server on which the instance of SQL Server is installed. |
Instance |
String |
The instance of SQL Server. |
IsClustered |
Boolean |
A Boolean value that is true if the instance is participating in failover clustering, or false if it is not. |
Version |
String |
The version of the instance of SQL Server. |
IsLocal |
Boolean |
A Boolean value that is true if the instance is local, or false if the instance is remote. |
Замечания
Изменения текста
The computer running the instance SQL Server might not receive responses to the EnumAvailableSqlServers method in a timely manner. The returned list might not show all the available instances of SQL Server on the network. When you call the EnumAvailableSqlServers method in subsequent tries, more servers might become visible on the network.
This method fails to list the local instance if a firewall is operating on the server. The firewall blocks any broadcast traffic issued when the method is called, even if the sender is from local machine.
Это пространство имен, класс или элемент поддерживаются только платформой Microsoft .NET Framework версии 2.0.
Пример
How to: Register Event Handlers and Subscribe to Event Handling in Visual Basic .NET
Синхронизация потоков
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.
Платформы
Платформы разработки
Список поддерживаемых платформ см. в разделе Hardware and Software Requirements for Installing SQL Server 2005.
Целевые платформы
Список поддерживаемых платформ см. в разделе Hardware and Software Requirements for Installing SQL Server 2005.
См. также
Справочник
SmoApplication Class
SmoApplication Members
Microsoft.SqlServer.Management.Smo Namespace