【发布时间】:2018-01-16 22:44:15
【问题描述】:
我创建了一个用户定义的函数并执行了。它返回以下错误消息。需要你的支持。
public partial class UserDefinedFunctions
{
[Microsoft.SqlServer.Server.SqlFunction]
public static SqlBoolean SqlFunctValidateUserCred()
{
bool verify = Crypto.VerifyHashedPassword("test", "test1");
return verify;
}
}
错误:
消息 6522,级别 16,状态 2,行 11 发生 .NET Framework 错误 在执行用户定义的例程或聚合期间 “SqlFunctValidateUserCred”:System.FormatException:长度无效 对于 Base-64 字符数组或字符串。 System.FormatException:在 System.Convert.FromBase64_Decode(Char* startInputPtr, Int32 inputLength, Byte* startDestPtr, Int32 destLength) 在 System.Convert.FromBase64CharPtr(Char* inputPtr, Int32 inputLength)
在 System.Convert.FromBase64String(String s) 在 System.Web.Helpers.Crypto.VerifyHashedPassword(字符串 hashedPassword, 字符串密码)在 UserDefinedFunctions.SqlFunctValidateUserCred()
【问题讨论】:
标签: c# sql-server sql-server-2014 sqlclr