请注意:此 API 现在已过时。
验证的内容数据库或配置数据库的连接字符串。
命名空间: Microsoft.SharePoint.Utilities
程序集: Microsoft.SharePoint(位于 Microsoft.SharePoint.dll 中)
语法
声明
<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 _
)
用法
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
)
参数
globalAdmin
类型:Microsoft.SharePoint.Administration.SPGlobalAdmin
strDbServer
类型:System.String一个字符串,包含的数据库服务器的名称。
strDbName
类型:System.String一个字符串,包含的数据库的名称。
strDbUser
类型:System.String一个字符串,包含数据库帐户的用户名时使用 SQL 身份验证。使用 Windows 身份验证时,请将此参数的值作为传递 null 。
strDbPassword
类型:System.String一个字符串,包含数据库密码时使用 SQL 身份验证。使用 Microsoft Windows 身份验证时,请将此参数的值作为传递 null 。
备注
如果不存在指定的服务器或访问被拒绝,或登录尝试失败,因为指定的数据库名称不存在,则ValidateDatabaseConnectionString方法将返回一个Microsoft.SharePoint.SPException例外项。