ExpressionStore.SaveExpression Method (PIA)

Use this method to save a new or modified expression to the expression store. For a new expression, the SaveExpression method automatically generates a unique expression ID and stores it with the expression.

Definition

[Visual Basic .NET]

Imports Microsoft.CommerceServer.Interop.Targeting
Imports ADODB26Lib     ‘ for _Recordset
…
Public Sub SaveExpression(pRSExpr As _Recordset)

[C#]

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

[Visual Basic .NET]

Parameters

  • pRSExpr
    The _Recordset interface of a Recordset object that contains the expression.

[C#]

Return Values

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
&H81100004 Invalid or missing expression body
&H8110000A Invalid expression category specified
&H81100003 Invalid expression name
&H81100006 A cycle was detected in the expression dependencies of this expression
&H81100009 Duplicate expression dependency
&H81100007 Duplicate expression name
&H81100008 Duplicate profile dependency
&H8110000B One or more of the expression dependencies refers to an expression ID that does not exist
&H81100005 The new name exceeds the maximum size of 30 characters
&H8110000D No connection string specified
&H81100002 Expression must have at least one profile dependency to be saved

[C#]

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

Value Description
0x8110001F Invalid connection
0x81100004 Invalid or missing expression body
0x8110000A Invalid expression category specified
0x81100003 Invalid expression name
0x81100006 A cycle was detected in the expression dependencies of this expression
0x81100009 Duplicate expression dependency
0x81100007 Duplicate expression name
0x81100008 Duplicate profile dependency
0x8110000B One or more of the expression dependencies refers to an expression ID that does not exist
0x81100005 The new name exceeds the maximum size of 30 characters
0x8110000D No connection string specified
0x81100002 Expression must have at least one profile dependency to be saved

Remarks

If the expression being saved is not currently in the expression store, the SaveExpression method generates a unique identifier and populates the ExprID field of the Recordset object. The identifier is a positive integer. For more information about the format and fields of the Recordset object, see Expression Recordset.

The ExpressionStore object performs rudimentary checks for expression dependencies when an expression is saved or deleted. This includes any direct references, a test for cyclic referencing, and any references to nonexistent expressions.

Call the Connect method before calling the SaveExpression method.

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.NewExpression

Copyright © 2005 Microsoft Corporation.
All rights reserved.