In starter site, email ID is declared as unique field. You need to customize and extend your profile system to enable such functionality (multiple profiles with same email ID).
Perform following tasks to enable this functionality.
- In database (startersite_profile), userprofile table make sure email column doesn’t have unique key.
- Add another column named “u_user_name” and make sure this column has unique key.
- If there is data already exist in the table then you may get error. Make sure you don’t apply unique key during column creation. Once column is created, copy email value (or some other unique value) to this column and then apply unique constraint on this column.
- Open commerce server manager. Navigate to Commerce server manager -> global resources -> profiles (startersite_profiles)-> data sources -> profileservice_sqlsource ->data Objects -> user object.
- Create a data member named “user_name” and point to the column “u_user_name”.
Open commerce server manager. Navigate to Commerce server manager -> global resources -> profiles (startersite_profiles)-> profile definitions -> user object. - Under general information -> add new property named “UserName” and point to data member “user_name” of data store.
- click on general information -> email, make sure required property is set to false and keytype is set to blank.
Till now, we have done configuration changes to use user name as unique key but to make this field as login Id, we need to tell UPM provider about this change. For that, we can do configuration changes in any of the following two places.
- web.config – By default upmprovider takes “GeneralInfo.email_address” as logon field. You need mention explicit that instead of email ID, use username.
<membership defaultProvider=”UpmProvider”>
<providers>
<add name=”UpmProvider” type=”Microsoft.CommerceServer.Runtime.Profiles.UpmMembershipProvider” logonNameProperty=”GeneralInfo.UserName”/>
</providers>
</membership> - you can pass this information in the code as part of collections.
UpmMembershipProvider provider = new UpmMembershipProvider();
System.Collections.Specialized.NameValueCollection collection = new System.Collections.Specialized.NameValueCollection();
collection.Add(“logonNameProperty”,”GeneralInfo.UserName”);
provider.Initialize(“UpmProvider”, collection);
bool registeredUser = provider.ValidateUser(“ravi.kanth”, “pass123″);
Response.Write(registeredUser.ToString());
If you like this post, please click on our sponsor advertisement.

microsoft server is hapfull for future.
thanks.