ExpressionStore.RenameExpression Method (PIA)

Use this method to rename an existing expression in the expression store. The new expression name must be unique or the operation will fail.

Definition

[Visual Basic .NET]

Imports Microsoft.CommerceServer.Interop.Targeting
…
Public Sub RenameExpression(nExprID As Integer,
 strNewName As String)

[C#]

public void RenameExpression(intnExprID,
 stringstrNewName);

Parameters

[Visual Basic .NET]

  • nExprID
    An Integer that contains the expression ID.
  • strNewName
    A String that contains the new name.

[C#]

  • nExprID
    An int that contains the expression ID.
  • strNewName
    A string that contains the new name.

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
&H81100003 Invalid expression name
&H81100007 Duplicate expression name
&H81100005 The new name exceeds the maximum size of 30 characters
&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
0x81100003 Invalid expression name
0x81100007 Duplicate expression name
0x81100005 The new name exceeds the maximum size of 30 characters
0x8110000D No connection string specified

Remarks

Use the GetExprID method to translate an expression name to its corresponding expression ID.

Call the Connect method before calling the RenameExpression method.

[Visual Basic .NET]

Example

' oExpressionStore is an ExpressionStore object connected to
' a valid expression store.
' 52997 is a valid expression ID retrieved from the GetExprId method.
oExpressionStore.RenameExpression(52997, "MyNewName")

Requirements

Namespace: Microsoft.CommerceServer.Interop.Targeting

Platforms: Windows 2000, Windows Server 2003

Assembly: exprarchlib (in exprarchlib)

See Also

ExpressionStore Class

ExpressionStore.Connect

ExpressionStore.GetExprID

Copyright © 2005 Microsoft Corporation.
All rights reserved.