2.1.5.18 UpdateUser
This method updates information about a user in the database.
Declaration
// C#
public override void UpdateUser(MembershipUser membershipUser);
Parameters
-
membershipUserA
MembershipUserobject populated with user information.
Exceptions
ArgumentException - One of the following conditions exists:
-
The
userNameproperty ofmembershipUseris an empty string, contains a comma, or is longer than 256 characters. -
The
emailproperty ofmembership Useris an empty string and theRequires Unique Em ailproperty is set totrue, or themailproperty is longer than 256 characters.
Argument Null Exception - The membership User parameter is null, or the surname or mail property of the membership User parameter is null.
System.Configuration.Provider.ProviderException - One of the following conditions exists:
-
The
surnameproperty of themembership Userparameter is not found in the membership database. -
The
mailproperty of themembership Userparameter is equal to an existing e-mail address in the membership database, and theRequires Unique Em ailproperty is set totrue. -
An error occurred when updating the user in the membership database.
Remarks
The specified user's Mail, Comment, IsApproved, Last Login Date, and LastActivityDate property values can be modified, and then updated by the UpdateUser method. However, the password for a user cannot. To update the password for a user, use the ChangePassword method of the MembershipUser class.