Compartilhar via


ValidateDatabaseConnectionString Method

The ValidateDatabaseConnectionString method of the SPUtility class validates the connection string for the content database or the configuration database.

Parameters

globalAdmin   A Microsoft.SharePoint.Administration.SPGlobalAdmin object.

strDbServer   A string that contains the name of the database server.

strDbName   A string that contains the name of the database.

strDbUser   A string that contains the user name for the database account when SQL authentication is used. Pass null as the value for this parameter when Windows authentication is used.

strDbPassword   A string that contains the database password when SQL authentication is used. Pass null as the value for this parameter when Microsoft Windows authentication is used.

Remarks

The ValidateDatabaseConnectionString method returns a Microsoft.SharePoint.SPException exception if the specified server does not exist or access is denied, or the logon attempt fails because the specified database name does not exist.

Requirements

Platforms: Microsoft Windows Server 2003

Security: Code Access Security