public override bool UnlockUser (string username)
{
CheckParam ("username", username, 256);
using (DbConnection connection = CreateConnection ()) {
try {
DbCommand command = factory.CreateCommand ();
command.Connection = connection;
command.CommandText = @"aspnet_Membership_UnlockUser"; ;
command.CommandType = CommandType.StoredProcedure;
AddParameter (command, "@ApplicationName", ApplicationName);
AddParameter (command, "@UserName", username);
DbParameter returnValue = AddParameter (command, "@ReturnVal", ParameterDirection.ReturnValue, DbType.Int32, null);
command.ExecuteNonQuery ();
if (GetReturnValue (returnValue) != 0)
return false;
}
catch (Exception e) {
throw new ProviderException ("Failed to unlock user", e);
}
}
return true;
}