ExpressionStore.GetExprID Method (PIA)

Use this method to translate the name of an expression into its corresponding expression ID.

Definition

[Visual Basic .NET]

Imports Microsoft.CommerceServer.Interop.Targeting
…
Public Function GetExprID(strExprName As String) As Integer

[C#]

using Microsoft.CommerceServer.Interop.Targeting;
…
public int GetExprID(stringstrExprName);

Parameters

[Visual Basic .NET]

  • strExprName
    A String that contains the expression name.

[C#]

  • strExprName
    A string that contains the expression name.

Return Values

[Visual Basic .NET] If this method completes successfully, it returns an Integer that contains the expression ID. On failure, the expression ID is set to EXPRID_INVALID (defined as -1).

[C#] This method returns an int that contains the expression ID. On failure, the expression ID is set to EXPRID_INVALID (defined as -1).

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
&H81100003 Invalid expression name, or expression name not found in store
&H8110000D No connection string specified

[C#]

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

Value Description
0x8110001F Invalid connection
0x81100003 Invalid expression name, or expression name not found in store
0x8110000D No connection string specified

Remarks

Use the GetExprName method to translate the ID of an expression into its corresponding expression name.

Call the Connect method before calling the GetExprID method.

[Visual Basic .NET]

Example

' lExpressionID is an Integer
' oExpressionStore is an ExpressionStore object connected to
' a valid expression store.

lExpressionID = oExpressionStore.GetExprID("MyExpression")

Requirements

Namespace: Microsoft.CommerceServer.Interop.Targeting

Platforms: Windows 2000, Windows Server 2003

Assembly: exprarchlib (in exprarchlib)

See Also

ExpressionStore Class

ExpressionStore.Connect

ExpressionStore.GetExpression

ExpressionStore.GetExprName

ExpressionStore.RenameExpression

Copyright © 2005 Microsoft Corporation.
All rights reserved.