IProfileService2::DeleteProfileByKey Method [C++]

Use this method to delete the ProfileObject object specified by a key member name/value pair and schema type. All properties associated with the profile are purged from the system.

Definition

[C++]

HRESULT IProfileService::DeleteProfileByKey(BSTRbstrKeyMemberName,
  VARIANTsValue,
  BSTRbstrType);

[Visual Basic]

Sub DeleteProfileByKey(strKeyMemberName As String,
  sValueAs Variant,
  strType As String)

Parameters

  • bstrKeyMemberName[C++]
    [in] A BSTR that contains the key member name.
  • strKeyMemberName[Visual Basic]
    [in] A String that contains the key member name.
  • sValue[C++]
    [in] A VARIANT that contains the key value.
  • sValue[Visual Basic]
    [in] A Variant that contains the key value.
  • bstrType[C++]
    [in] A BSTR that contains the profile schema type.
  • strType[Visual Basic]
    [in] A String that contains the profile schema type.

Return Values

[C++] This method returns an HRESULT indicating whether it completed successfully. See the Error Values section for more details.

[Visual Basic] None.

Error Values

[C++] The Errors property stores the collection of errors encountered in the last Profiles resource operation. For more information, see IProfileService::get_Errors.

[Visual Basic] The Errors property stores the collection of errors encountered in the last Profiles resource operation. For more information, see ProfileService.Errors.

Remarks

Use the DeleteProfile method to delete a profile by specifying a primary key value and schema type.

Call the Initialize method before you use this ProfileService method.

Ee823499.caution(en-US,CS.20).gif Caution

  • Care must be taken when deleting ProfileObject objects due to possible expression dependencies. See the ExpressionStore and ExpressionEval objects for details on expressions.

For more information about memory ownership issues related to COM property and method parameters, see Managing COM Parameter Memory.

[Visual Basic]

Example

' oProfileService is a Commerce ProfileService object

oProfileService.DeleteProfileByKey("user_id",_
 "{74A38551-D6D8-FFD0-12BF-0A20C90DC8D1}" "UserObject")

See Also

[C++]ProfileService Object

[C++]IProfileService::CreateProfile

[C++]IProfileService::DeleteProfile

[C++]ExpressionEval Object

[C++]ExpressionStore Object

[Visual Basic]ProfileService Object

[Visual Basic]ProfileService.CreateProfile

[Visual Basic]ProfileService.DeleteProfile

[Visual Basic]ExpressionEval Object

[Visual Basic]ExpressionStore Object

Copyright © 2005 Microsoft Corporation.
All rights reserved.