我創建了用戶定義的函數並執行。它返回下面的錯誤消息。需要你的支持。SQL CLR - Base-64字符數組或字符串的無效長度
public partial class UserDefinedFunctions
{
[Microsoft.SqlServer.Server.SqlFunction]
public static SqlBoolean SqlFunctValidateUserCred()
{
bool verify = Crypto.VerifyHashedPassword("test", "test1");
return verify;
}
}
錯誤:
Msg 6522, Level 16, State 2, Line 11 A .NET Framework error occurred during execution of user-defined routine or aggregate "SqlFunctValidateUserCred": System.FormatException: Invalid length for a Base-64 char array or string. System.FormatException: at System.Convert.FromBase64_Decode(Char* startInputPtr, Int32 inputLength, Byte* startDestPtr, Int32 destLength) at System.Convert.FromBase64CharPtr(Char* inputPtr, Int32 inputLength)
at System.Convert.FromBase64String(String s) at System.Web.Helpers.Crypto.VerifyHashedPassword(String hashedPassword, String password) at UserDefinedFunctions.SqlFunctValidateUserCred()
能否請你解釋一下是你的文章回答問題? –