SPUtility.ValidateDatabaseConnectionString method
NOTE: This API is now obsolete.
驗證的內容資料庫或設定資料庫的連線字串。
Namespace: Microsoft.SharePoint.Utilities
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Syntax
'宣告
<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
Type: Microsoft.SharePoint.Administration.SPGlobalAdmin
strDbServer
Type: System.String包含的資料庫伺服器名稱的字串。
strDbName
Type: System.String字串,包含資料庫的名稱。
strDbUser
Type: System.String使用 SQL 驗證時,包含資料庫帳戶的使用者名稱的字串。使用 Windows 驗證時,請為此參數的值傳遞 null 。
strDbPassword
Type: System.String使用 SQL 驗證時,包含資料庫密碼字串。使用 Microsoft Windows 驗證時,請為此參數的值傳遞 null 。
備註
如果指定的伺服器不存在或存取被拒,或登入嘗試失敗,因為指定的資料庫名稱不存在, ValidateDatabaseConnectionString方法會傳回Microsoft.SharePoint.SPException例外狀況。