SimpleMembershipProvider.CreateUserAndAccount Method (String, String, Boolean, IDictionary<String, Object>)
Creates a new user profile and a new membership account.
Namespace: WebMatrix.WebData
Assembly: WebMatrix.WebData (in WebMatrix.WebData.dll)
Syntax
'Declaration
Public Overrides Function CreateUserAndAccount ( _
userName As String, _
password As String, _
requireConfirmation As Boolean, _
values As IDictionary(Of String, Object) _
) As String
'Usage
Dim instance As SimpleMembershipProvider
Dim userName As String
Dim password As String
Dim requireConfirmation As Boolean
Dim values As IDictionary(Of String, Object)
Dim returnValue As String
returnValue = instance.CreateUserAndAccount(userName, _
password, requireConfirmation, values)
public override string CreateUserAndAccount(
string userName,
string password,
bool requireConfirmation,
IDictionary<string, Object> values
)
public:
virtual String^ CreateUserAndAccount(
String^ userName,
String^ password,
bool requireConfirmation,
IDictionary<String^, Object^>^ values
) override
abstract CreateUserAndAccount :
userName:string *
password:string *
requireConfirmation:bool *
values:IDictionary<string, Object> -> string
override CreateUserAndAccount :
userName:string *
password:string *
requireConfirmation:bool *
values:IDictionary<string, Object> -> string
public override function CreateUserAndAccount(
userName : String,
password : String,
requireConfirmation : boolean,
values : IDictionary<String, Object>
) : String
Parameters
- userName
Type: System.String
The user name.
- password
Type: System.String
The password.
- requireConfirmation
Type: System.Boolean
(Optional) true to specify that the user account must be confirmed by using the ConfirmAccount(String) method; otherwise, false. The default is false.
- values
Type: System.Collections.Generic.IDictionary<String, Object>
(Optional) A dictionary that contains additional key/value pair attributes that you can add to the data store as default values for new user profile. The key for each entry is the database column, and the value of each entry is the value for the column. The default is null reference (Nothing in Visual Basic).
Return Value
Type: System.String
A token that can be sent to the user to confirm the user account.
Exceptions
Exception | Condition |
---|---|
InvalidOperationException | The SimpleMembershipProvider class was not initialized using a call to the InitializeDatabaseConnection() method. |
MembershipCreateUserException | A membership account for this user name already exists in the membership database. |
Remarks
The token return value can be sent to the user in an email message as part of a link that the user clicks on to verify their account. For more information, see the ConfirmAccount(String) method.