DB2 Version 10.1 for Linux, UNIX, and Windows

DB2DataSourceEnumerator.GetDataSources Method

Returns a DataTable with information about all the visible database server instances and databases on those instances.

Overload list

Name Description
GetDataSources() Overridden. Returns a DataTable with information about all the visible database server instances and databases on those instances.
GetDataSources(Boolean) Returns a DataTable with information about all the visible database server instances and databases on those instances. A boolean parameter enables the restriction of results to locally cataloged databases.
GetDataSources(String Host, String Port, String UID, String PWD) Enumerates the databases on the instance represented by the Host/Port
Note: Host being the host system the database instance is running on, and port being the port on which the instance accepts connections.
The instance may be either DB2 or Informix®. When the instance is DB2, the UID and PWD are ignored. When the instance is Informix the UID and PWD must represent a user capable of connecting to the Informix instance.

Remarks

Using the GetDataSources method, you can find any visible database server instances and databases on those instances. The GetDataSources method works through the IBM® Data Server Provider for .NET and is able to see the following information:
  • All databases cataloged on the local instance. In the case where there are multiple local instances, only the instance to which the application is attached will be visible.
  • All visible remote database server instances and their databases. In order to be visible, the remote database server instances must have a running database administration server (DAS), which is configured to respond to Search and Known Discovery requests.
Database server instances without any databases will not appear in the DataTable. The db2dsdriver configuration file will be used while generating the database, server and alias information.

Version information

Last update
This topic was last updated for: IBM DB2 Version 9.7 FP4
.NET Framework version
Supported in: 2.0, 3.0, 3.5, and 4.0
IBM Data Server Client
Supported in: IBM DB2 Version 9