Last week I ran in to two issues, “Failed to set value for profile property ’email_address’ and “Object or data matching the name, range, or selection criteria was not found within the scope of this operation”

Following are the two exceptions.

An exception has occured.

ExceptionType: 'CommerceProfileSystemException'
ExceptionMessage: 'Failed to set value for profile property 'email_address'.'
StackTrace: ' at Microsoft.CommerceServer.Runtime.Profiles.ProfileProperty.set_Value(Object value)
at Microsoft.CommerceServer.Runtime.Profiles.UpmMembershipProvider.CreateUser(String username, String password, String email, String passwordQuestion, String passwordAnswer, Boolean isApproved, Object providerUserKey, MembershipCreateStatus& status)
at Microsoft.Commerce.UI.WebParts.CommercePropertyBaseWebPart.CreateUser()
at Microsoft.Commerce.UI.WebParts.CommercePropertyBaseWebPart.OnBubbleEvent(Object source, EventArgs args)'
Source: 'Microsoft.CommerceServer.Runtime'
TargetSite: 'Void set_Value(System.Object)'
Inner exception:
ExceptionType: 'COMException'
ExceptionMessage: 'Exception from HRESULT: 0xC1004043'
StackTrace: ' at ADODB.Field.set_Value(Object pvar)
at Microsoft.CommerceServer.Runtime.Profiles.ProfileProperty.set_Value(Object value)'
Source: 'ADODB'
TargetSite: 'Void set_Value(System.Object)'

And

Object or data matching the name, range, or selection criteria was not found within the scope of this operation.
Stack Trace:
[COMException (0x80040e19): Object or data matching the name, range, or selection criteria was not found within the scope of this operation.]
Microsoft.CommerceServer.Interop.Profiles.IProfileObject2.GetInfo() +0
Microsoft.CommerceServer.Runtime.Profiles.Profile.Refresh() +166
[CommerceProfileSystemException: Failed to refresh profile state from underlying stores.]
Microsoft.CommerceServer.Runtime.Profiles.Profile.Refresh() +454
Microsoft.CommerceServer.Runtime.Profiles.UpmMembershipUser.ValidateUser(String password) +55
System.Web.UI.WebControls.Login.AuthenticateUsingMembershipProvider(AuthenticateEventArgs e) +75
   System.Web.UI.WebControls.Login.AttemptLogin() +152
System.Web.UI.WebControls.Login.OnBubbleEvent(Object source, EventArgs e) +124
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +70
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +29
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2981

Following are the checkpoint which helped me to resolve the issue.

The connection string was having invalid provider.

clip_image002

Also check following possibility.

Check Ravi’s Blog for details

  • The reason is the guid passed already exists in the user object.

Check de-Hao’s Blog

  • check for all the custom attribute for the user object tables ( SQL and Commerce server Properties)
  • check and associate the properties to data source under commerce server manager
  • check you donn’t have case mistake in MetadataDefinitions.xml.