Hi,
I am trying to create a new address profile using the following code:
------------------------------------------------------
Dim newAddr As Profiles.Profile
Dim newGuid As Guid
If
current.ProfileSystem.GetProfile(userProfile("GeneralInfo.****pping_address").Value,
"address") Is Nothing Then
newAddr = current.ProfileSystem.CreateProfile(newGuid.ToString, "address")
End If
-----------------------------------------------
I then receive the following error:
Exception Details: System.Runtime.InteropServices.COMException: Profile
object already exists.
[COMException (0xc100400b): Profile object already exists.
]
Microsoft.CommerceServer.Interop.Profiles.ProfileServiceClass.CreateProfile(Object
sValue, String bstrType) +0
Microsoft.CommerceServer.Runtime.Profiles.Profile..ctor(ProfileContext
profileService, String keyValue, String profileType, Boolean
retrieveProfile)
+77
[CommerceProfileAlreadyExist***ception: A profile object with conflicting
values for one or more key members already exists.]
Microsoft.CommerceServer.Runtime.Profiles.Profile..ctor(ProfileContext
profileService, String keyValue, String profileType, Boolean
retrieveProfile)
+357
Microsoft.CommerceServer.Runtime.Profiles.ProfileContext.CreateProfile(String
keyValue, String profileType) +170
healthchemist.EditProfile.btnSave_Click(Object sender, EventArgs e) in
C:\Inetpub\commerceroot\healthchemist\EditProfile.aspx.vb:160
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String
eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1262
The error occurs in the following line of code:
current.ProfileSystem.CreateProfile(newGuid.ToString, "address")
Can anyone help me with this problem?
Thanks.


|