Skip to content

An exception of type 'System.FormatException' occurred

Sivakumar

Sivakumar

Asked Sep 7, 2015, 8:05 PM EDT2 answers
Share
LinkedInX
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.
C#
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();
        }
and this is my tables structure :
I am using Rest tool to get a values
Please give a solution for that.

2 Answers

Know the answer? Post it. Somebody with the same question will find it here.

  • 0
    Have you set the Application content type in the rest tool
    0
  • Sivakumar
    0
    Yes i set the content type in a rest tool
    0