DatabaseProvider.GetDatabaseHostName Method

IIS 7.0

Returns the host name of the computer where the database in the connection string is located.

Namespace:  Microsoft.Web.Management.DatabaseManager
Assembly:  Microsoft.Web.Management.DatabaseManager (in Microsoft.Web.Management.DatabaseManager.dll)

public abstract string GetDatabaseHostName(
	string connectionString


Type: System.String
The connection string for the database connection.

Return Value

Type: System.String
A string that contains the host name for the computer where the database is located.

Your provider must implement the GetDatabaseHostName method in order to return the host name of the computer that is hosting the database for your provider.

The following code sample illustrates an example GetDatabaseHostName method that returns the host name of the database.

        // Retrieve the hostname for the database server.
        public override string GetDatabaseHostName( string connectionString )
            // Return the computer name.
            return System.Environment.MachineName;