COMException (0xc1004043)

Hi all,
I’m getting this error when I try to obtain a profile:

A duplicate value for unique key member GeneralInfo.email_address found while building indices for profile UserObject. Check the underlying store for uniqueness of the property.

This error occurs at this line:

userProfile = CommerceContext.Current.ProfileSystem.GetProfile(campo, valor, "UserObject");

I’m sure that in my database there’s no duplicated email address. This behavior occurs at some profiles that were inserted directly at the database, because this profiles have been migrated from an older system (commerce server 2002). I’m sure that the problem is at the UserObject database, since there are other profile that use the same Address and Telephone profiles inside, and doesn’t appear to have any problem.

Any tips about this

Thanks,
Andre Nobre




Answer this question

COMException (0xc1004043)

  • fredmxm354

    Let me explain what’s going on, and a solution. First of all, I wrote a post at my blog about this (but only in portuguese), andrenobre.wordpress.com.

    I was executing a GetProfile using a unique key property. This method was generating an exception, COM Exception (0xc1004043). I read an article about this at microsoft, but It was about nchar - nvarchar columns at the database. My column is a nvarchar one, so It was not what I needed. But reading the article, I perceived that my column that was mapped to the unique key property in the database had spaces padded at the end of the string. This was the problem: In a searchable property (nvarchar column) I can’t have spaces padded at the end.

    Although I know the solution, I want to know why this exception was generated. I still don’t understand this.



  • COMException (0xc1004043)