SPUtility.ValidateDatabaseConnectionString Method

NOTE: This API is now obsolete.

Validates the connection string for the content database or the configuration database.

Namespace:  Microsoft.SharePoint.Utilities
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: No

Syntax

'Declaration
<ObsoleteAttribute("This method is not longer needed.", False)> _
Public Shared Sub ValidateDatabaseConnectionString ( _
    globalAdmin As SPGlobalAdmin, _
    strDbServer As String, _
    strDbName As String, _
    strDbUser As String, _
    strDbPassword As String _
)
'Usage
Dim globalAdmin As SPGlobalAdmin
Dim strDbServer As String
Dim strDbName As String
Dim strDbUser As String
Dim strDbPassword As StringSPUtility.ValidateDatabaseConnectionString(globalAdmin, _
    strDbServer, strDbName, strDbUser, _
    strDbPassword)
[ObsoleteAttribute("This method is not longer needed.", false)]
public static void ValidateDatabaseConnectionString(
    SPGlobalAdmin globalAdmin,
    string strDbServer,
    string strDbName,
    string strDbUser,
    string strDbPassword
)

Parameters

  • 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.

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.

See Also

Reference

SPUtility Class

SPUtility Members

Microsoft.SharePoint.Utilities Namespace