ExpressionStore.Import Method (PIA)

Use this method to import expressions from a file into the expression store.

Definition

[Visual Basic .NET]

Imports Microsoft.CommerceServer.Interop.Targeting
…
Public Sub Import(bstrFileName As String)

[C#]

using Microsoft.CommerceServer.Interop.Targeting;
…
public void Import(stringbstrFileName);

Parameters

[Visual Basic .NET]

  • bstrFileName
    A String that contains the path and name of the file from which to import the expressions.

[C#]

  • bstrFileName
    A string that contains the path and name of the file from which to import the expressions.

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
&H8110000D No connection string specified
&H8110000C Cannot import to a non-empty store

[C#]

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

Value Description
0x8110001F Invalid connection
0x8110000D No connection string specified
0x8110000C Cannot import to a non-empty store

Remarks

The expression store must be empty in order to import expressions.

The import file must contain the XML schema for the expression Recordset followed by the XML representation of each expression Recordset. Expression Recordsets with invalid expression bodies are imported but will cause an error upon evaluation.

Use the Export method to copy the XML schema for the expression Recordset and all the expressions from the expression store to a file.

Call the Connect method before calling the Import method.

[Visual Basic .NET]

Example

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

oExpressionStore.Import("\SomePath\Expressions.xml")

Requirements

Namespace: Microsoft.CommerceServer.Interop.Targeting

Platforms: Windows 2000, Windows Server 2003

Assembly: exprarchlib (in exprarchlib)

See Also

Expression Recordset

Expression XML Structures

ExpressionStore Class

ExpressionStore.Export

Copyright © 2005 Microsoft Corporation.
All rights reserved.