ExpressionStore.GetExpression Method (PIA)

Use this method to retrieve an ADO _Recordset interface to a hierarchical Recordset object that contains the specified expression.

Definition

[Visual Basic .NET]

Imports Microsoft.CommerceServer.Interop.Targeting
Imports ADODB26Lib     ‘ for _Recordset
…
Public Function GetExpression(nExprID As Integer) As _Recordset

[C#]

using Microsoft.CommerceServer.Interop.Targeting;
using ADODB26Lib;                              //For _Recordset
…
public _Recordset GetExpression(intnExprID);

Parameters

[Visual Basic .NET]

  • nExprID
    An Integer that contains the unique identifier of the expression.

[C#]

  • nExprID
    An int that contains the unique identifier of the expression.

Return Values

[Visual Basic .NET] This method returns the _Recordset interface of a Recordset object. If successful, the Recordset object contains the specified expression. If unsuccessful, the Recordset object is set to Null.

[C#] This method returns an ADO _Recordset interface to a hierarchical Recordset object that contains the expression.

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
&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
0x8110000D No connection string specified

Remarks

To access all expressions in the connected expression store, use the GetAllExprs method.

Call the Connect method before calling the GetExpression method.

The returned _Recordset interface to a Recordset contains valid data only if the method completes successfully.

Requirements

Namespace: Microsoft.CommerceServer.Interop.Targeting

Platforms: Windows 2000, Windows Server 2003

Assembly: exprarchlib (in exprarchlib)

See Also

Expression Recordset

ExpressionStore Class

ExpressionStore.Connect

ExpressionStore.GetAllExprs

ExpressionStore.NewExpression

Copyright © 2005 Microsoft Corporation.
All rights reserved.