ProfileService.DeleteProfile Method (PIA)

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

[Visual Basic .NET]

Imports Microsoft.CommerceServer.Interop.Profiles
…
Public Sub DeleteProfile(sValue As Object,
  strType As String)

[C#]

using Microsoft.CommerceServer.Interop.Profiles;
…
public void DeleteProfile(objectsValue,
  stringbstrType);

Parameters

[Visual Basic .NET]

  • sValue
    An Object that contains the primary key value. The variable types permitted for this object are String or Integer.
  • strType
    A String that contains the profile schema type.

[C#]

  • sValue
    An object that contains the primary key value. The variable types permitted for this object are string or int.
  • bstrType
    A string that contains the profile schema type.

Exceptions

This method may throw one of many mapped exceptions or an exception of type COMException. See Standard COM Errors for additional details.

The Errors property stores the collection of errors encountered in the last Profiles resource operation if an exception is thrown. 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.

Ee783892.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 about expressions.

[Visual Basic .NET]

Example

' oProfileService is a Commerce ProfileService object

oProfileService.DeleteProfile("Joeuser@microsoft.com", "UserObject")

Requirements

Namespace: Microsoft.CommerceServer.Interop.Profiles

Platforms: Windows 2000, Windows Server 2003

Assembly: mscsupslib (in mscsupslib.dll)

See Also

ProfileService Class

ProfileService.CreateProfile

ProfileService.DeleteProfileByKey

ExpressionEval Object

ExpressionStore Object

Copyright © 2005 Microsoft Corporation.
All rights reserved.