SPUtility.ValidateDatabaseConnectionString method
SharePoint 2013
NOTE: This API is now obsolete.
Validates the connection string for the content database or the configuration database.
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
[ObsoleteAttribute("This method is not longer needed.", false)] public static void ValidateDatabaseConnectionString( SPGlobalAdmin globalAdmin, string strDbServer, string strDbName, string strDbUser, string strDbPassword )
Parameters
- globalAdmin
- Type: Microsoft.SharePoint.Administration.SPGlobalAdmin
A Microsoft.SharePoint.Administration.SPGlobalAdmin object.
- strDbServer
- Type: System.String
A string that contains the name of the database server.
- strDbName
- Type: System.String
A string that contains the name of the database.
- strDbUser
- Type: System.String
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
- Type: System.String
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.
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.