c# - Linq to Sql where condition String NotSupported Exception -
i trying pull password length asp.net tables following linq sql query
(from t1 in aspnet_users join t2 in aspnet_memberships on t1.userid equals t2.userid decrypt(t2.password).length< 8 || decrypt(t2.password).length>16 select new { t1.username, t2.email, length=decrypt(t2.password).length})
but when try run code. getting following error.
notsupportedexception: method 'system.string a(system.string)' has no supported translation sql.
can guys give me idea fix it?
you cannot use c# method, in case decrypt
, in linq sql. works linq object not linq sql whole linq query converted sql query , compiler fails recognize methods.
for this, can convert linq code lambda expression, , make func<>
delegate decrypt, , use in clause.
Comments
Post a Comment