Sivakumar

Sivakumar

  • NA
  • 551
  • 218.4k

An exception of type 'System.FormatException' occurred

Sep 8 2015 12:05 AM
Hi,
I am trying to login my web api using rest tool get an error like this :
An exception of type 'System.FormatException' occurred in mscorlib.dll but was not handled in user code

Additional information: The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters.
public int ValidateAndGetMemberID(string username, string password)
{
MemberLogin ml = _DataContext.MemberLogins.SingleOrDefault(m => string.Compare(m.MemberLoginName, username, true) == 0);

if (ml != null
&& Crypto.VerifyHashedPassword(ml.Member.LoginPassword, password) == true)
return ml.Member.MemberID;

throw new InvalidCredentialException();
}
This is my url : http://localhost:54075/api/members/login
and this is my tables structure :
I am using Rest tool to get a values
Please give a solution for that.

Answers (2)