MembershipCreateStatus - An unknown error occurred


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: MembershipCreateStatus - An unknown error occurred

  1. #1
    Join Date
    Jan 2007
    Posts
    92

    MembershipCreateStatus - An unknown error occurred

    How can i determine what the error is when none of the enumeration errors have been selected. this is my switch statement

    switch (localStatus)
    {
    case MembershipCreateStatus.Success:
    lblCreateUserStatus.ForeColor = System.Drawing.Color.Green;
    lblCreateUserStatus.Text = "The user account was successfully created!";
    //have to create user in CMM customer object also
    break;
    case MembershipCreateStatus.DuplicateUserName:
    lblCreateUserStatus.Text = "There already exists a user with this username.";
    break;
    case MembershipCreateStatus.DuplicateEmail:
    lblCreateUserStatus.Text = "There already exists a user with this email address.";
    break;
    case MembershipCreateStatus.InvalidEmail:
    lblCreateUserStatus.Text = "There email address you provided in invalid.";
    break;
    case MembershipCreateStatus.InvalidAnswer:
    lblCreateUserStatus.Text = "There security answer was invalid.";
    break;
    case MembershipCreateStatus.InvalidPassword:
    lblCreateUserStatus.Text = "The password you provided is invalid. It must be seven characters long and have at least one non-alphanumeric character.";
    break;
    case MembershipCreateStatus.ProviderError:
    lblCreateUserStatus.ForeColor = System.Drawing.Color.Red;
    lblCreateUserStatus.Text = "There was a provider error; the user account was NOT created.";
    break;
    case MembershipCreateStatus.InvalidProviderUserKey:
    lblCreateUserStatus.ForeColor = System.Drawing.Color.Red;
    lblCreateUserStatus.Text = "There was a provider User Key error; the user account was NOT created.";
    break;
    case MembershipCreateStatus.InvalidUserName:
    lblCreateUserStatus.ForeColor = System.Drawing.Color.Red;
    lblCreateUserStatus.Text = "The username is invalid.";
    break;
    default:
    lblCreateUserStatus.ForeColor = System.Drawing.Color.Red;
    lblCreateUserStatus.Text = "There was an unknown error; the user account was NOT created.";
    break;
    }



    the default is always chosen is there a way to debug what error is really happening?

  2. #2
    Join Date
    Nov 2003
    Location
    Portland, OR
    Posts
    8,387
    I would wrap the call to CreateUser in a try...catch block and see what the exception says.
    Phil Weber
    http://www.philweber.com

    Please post questions to the forums, where others may benefit.
    I do not offer free assistance by e-mail. Thank you!

Similar Threads

  1. Unknown Runtime Error
    By dzirkelb in forum AJAX
    Replies: 1
    Last Post: 05-03-2007, 10:16 AM
  2. Replies: 1
    Last Post: 03-26-2007, 09:45 AM
  3. Accepting mail from unknown aliases
    By Jimmy Dohee in forum Enterprise
    Replies: 0
    Last Post: 06-21-2002, 08:00 PM
  4. Authentication process unknown
    By Rich Smith in forum Enterprise
    Replies: 0
    Last Post: 02-26-2001, 08:51 PM
  5. Ado 2.1 - Unknown error message
    By touri in forum VB Classic
    Replies: 0
    Last Post: 05-18-2000, 10:01 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center