SqlDataSourceEnumerator::GetDataSources Method ()
Retrieves a DataTable containing information about all visible SQL Server 2000 or SQL Server 2005 instances.
Assembly: System.Data (in System.Data.dll)
The table returned by this method contains the following columns, all of which contain strings:
Name of the server.
Name of the server instance. Blank if the server is running as the default instance.
Indicates whether the server is part of a cluster.
Version of the server (8.00.x for SQL Server 2000, and 9.00.x for SQL Server 2005).
Due to the nature of the mechanism used by SqlDataSourceEnumerator to locate data sources on a network, the method will not always return a complete list of the available servers, and the list might not be the same on every call. If you plan to use this function to let users select a server from a list, make sure that you always also supply an option to type in a name that is not in the list, in case the server enumeration does not return all the available servers. In addition, this method may take a significant amount of time to execute, so be careful about calling it when performance is critical.
Available since 2.0