MembershipProvider.GetUserNameByEmail(String) Method


Gets the user name associated with the specified email address.

 abstract System::String ^ GetUserNameByEmail(System::String ^ email);
public abstract string GetUserNameByEmail (string email);
abstract member GetUserNameByEmail : string -> string
Public MustOverride Function GetUserNameByEmail (email As String) As String



The email address to search for.


The user name associated with the specified email address. If no match is found, return null.


For an example of a MembershipProvider implementation, see Implementing a Profile Provider.


Takes, as input, an email address and returns the first user name from the data source where the email address matches the supplied email parameter value.

If no user name is found with a matching email address, null is returned.

If multiple user names are found that match a particular email address, only the first user name found should be returned. You can implement a custom mechanism for ensuring a unique email address for each user name such as the RequiresUniqueEmail property supported by the SqlMembershipProvider provider.

Applies to

See also