ok jorgem i converted it into c# and tried, it worked but the problem is that SHA1 i used in sqlserver2008 and the one i used in asp.net(c#), produces different hashes, which couldn't be compared at time of login ,