IProfileService2::DeleteProfile Method [C++]

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

Definition

[C++]

HRESULT IProfileService::DeleteProfile(VARIANTsValue,
  BSTRbstrType);

[Visual Basic]

Sub DeleteProfile(sValue As Variant,
  strType As String)

Parameters

  • sValue[C++]
    [in] A VARIANT that contains the primary key value.
  • sValue[Visual Basic]
    [in] A Variant that contains the primary 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

If the DeleteProfile method is called because of an error in creating a new ProfileObject object, any error message produced should be ignored.

Use the DeleteProfileByKey method to delete a profile specified by a key member/value pair and schema type.

Call the Initialize method before you use this ProfileService method.

Ee797084.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.DeleteProfile("Joeuser@microsoft.com", "UserObject")

See Also

[C++]ProfileService Object

[C++]IProfileService::CreateProfile

[C++]IProfileService::DeleteProfileByKey

[C++]ExpressionEval Object

[C++]ExpressionStore Object

[Visual Basic]ProfileService Object

[Visual Basic]ProfileService.CreateProfile

[Visual Basic]ProfileService.DeleteProfileByKey

[Visual Basic]ExpressionEval Object

[Visual Basic]ExpressionStore Object

Copyright © 2005 Microsoft Corporation.
All rights reserved.