title: Error in SqlMembershipProvider.GetPasswordWithFormat
body: <p>I have the following error in my asp.net login page:</p>
  
  <pre><code>Unable to cast object of type 'System.Int32' to type 'System.String'
  </code></pre>
  
  <p>with stack trace:</p>
  
  <pre><code>at System.Data.SqlClient.SqlBuffer.get_String()     
     at System.Web.Security.SqlMembershipProvider.GetPasswordWithFormat(String username, Boolean updateLastLoginActivityDate, Int32&amp; status, String&amp; password, Int32&amp; passwordFormat, String&amp; passwordSalt, Int32&amp; failedPasswordAttemptCount, Int32&amp; failedPasswordAnswerAttemptCount, Boolean&amp; isApproved, DateTime&amp; lastLoginDate, DateTime&amp; lastActivityDate)     
     at System.Web.Security.SqlMembershipProvider.CheckPassword(String username, String password, Boolean updateLastLoginActivityDate, Boolean failIfNotApproved, String&amp; salt, Int32&amp; passwordFormat)     
     at System.Web.Security.SqlMembershipProvider.ValidateUser(String username, String password)     
     at System.Web.UI.WebControls.Login.AuthenticateUsingMembershipProvider(AuthenticateEventArgs e)     
     at System.Web.UI.WebControls.Login.AttemptLogin()     
     at System.Web.UI.WebControls.Login.OnBubbleEvent(Object source, EventArgs e)     
     at System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args)     
     at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)     
     at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
  </code></pre>
  
  <p>The error is not occured every time.</p>
  
  <p>Any ideas?</p>