Share via


IProfileService2::DeleteProfileByKey Method

For the latest version of Commerce Server 2007 Help, see the Microsoft Web site.

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.

HRESULT IProfileService::DeleteProfileByKey(
  BSTR bstrKeyMemberName,
  VARIANT sValue,
  BSTR bstrType
);
Sub DeleteProfileByKey(
    strKeyMemberName As String,
    sValue As Variant,
    strType As String
)

Parameters

  • bstrKeyMemberName
    [C++]

    [in] A BSTR that contains the key member name.

    [Visual Basic]

    A String that contains the key member name.

  • sValue
    [C++]

    [in] A VARIANT that contains the key value.

    [Visual Basic]

    A Variant that contains the key value.

  • bstrType
    [C++]

    [in] A BSTR that contains the profile schema type.

    [Visual Basic]

    A String that contains the profile schema type.

Return Value

[C++]

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

[Visual Basic]

None.

Error Values

The Errors property stores the collection of errors encountered in the last Profiles resource operation. For more information, see IProfileService::get_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.

Warning

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

Example

' oProfileService is a Server ProfileService object.

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

See Also

Other Resources

ProfileService Object

IProfileService2::CreateProfile Method

IProfileService2::DeleteProfile Method

ExpressionEval Object

ExpressionStore Object