ExpressionStore.DeleteExpression Method (PIA)

Use this method to delete an existing expression from the expression store.

Definition

[Visual Basic .NET]

Imports Microsoft.CommerceServer.Interop.Targeting
…
Public Sub DeleteExpression(nExprID As Integer,
 flags As Integer)

[C#]

using Microsoft.CommerceServer.Interop.Targeting;
…
public void DeleteExpression(intnExprID,
 intflags);

Parameters

[Visual Basic .NET]

  • nExprID
    An Integer that specifies the expression to be deleted.
  • flags
    An Integer that contains the optional control flags. This parameter is currently unused and should be set to zero (0).

[C#]

  • nExprID
    An int that specifies the expression to be deleted.
  • flags
    An int that contains the optional control flags. This parameter is currently unused and should be set to zero (0).

Exceptions

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

[Visual Basic .NET]

The following table shows the custom COM errors that a COMException can wrap.

Value Description
&H8110001F Invalid connection
&H8110000A Invalid expression ID specified, or expression ID not found in store
&H81100010 Delete operation failed, possibly due to other expressions having dependencies on this expression
&H8110000D No connection string specified

[C#]

The following table shows the custom COM errors that COMException can wrap.

Value Description
0x8110001F Invalid connection
0x8110000A Invalid expression ID specified, or expression ID not found in store
0x81100010 Delete operation failed, possibly due to other expressions having dependencies on this expression
0x8110000D No connection string specified

Remarks

If the specified expression has a non-zero reference count, meaning that other expressions depend on the specified expression, the expression is not deleted.

Call the Connect method before calling the DeleteExpression method.

[Visual Basic .NET]

Example

' oExpressionStore is an ExpressionStore object connected to
' a valid expression store.
' 59552 is a valid expression ID retrieved by the GetExprID method.

oExpressionStore.Delete(59552, 0)

Requirements

Namespace: Microsoft.CommerceServer.Interop.Targeting

Platforms: Windows 2000, Windows Server 2003

Assembly: exprarchlib (in exprarchlib)

See Also

ExpressionStore Class

ExpressionStore.Connect

ExpressionStore.NewExpression

Copyright © 2005 Microsoft Corporation.
All rights reserved.