我创建了用户定义的函数并执行。它返回下面的错误消息。需要你的支持。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()
能否请你解释一下是你的文章回答问题? –