ExpressionEvaluator.Connect Method (PIA)

Use this method to establish communication with an expression store.

Definition

[Visual Basic .NET]

Imports Microsoft.CommerceServer.Interop.Targeting
…
Public Sub Connect(vConnectInfo As Object)

[C#]

using Microsoft.CommerceServer.Interop.Targeting;
…
public void Connect(objectvConnectInfo);

Parameters

[Visual Basic .NET]

  • vConnectInfo
    An Object that describes the expression store connection information. This may be a String containing the connection information or a reference to an existing ExpressionStore object.

[C#]

  • vConnectInfo
    An object that describes the expression store connection data. This may be a string containing the connection information or an existing ExpressionStore object.

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
&H8110001E Specified database does not contain a valid expression store
&H8110000D No connection string specified
&H8110000F Insufficient access permissions on the expression store database

[C#]

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

Value Description
0x8110001F Invalid connection
0x8110001E Specified database does not contain a valid expression store
0x8110000D No connection string specified
0x8110000F Insufficient access permissions on the expression store database

Remarks

If a connection string is passed as the input parameter, the ExpressionEval object creates an ExpressionStore object that uses the connection string to access the expression store. Upon destruction, the ExpressionEval object destroys the ExpressionStore object.

The connection string for the expression store may be obtained through the SiteConfigReadOnly object or through the Commerce Server Manager console from the s_BizDataStoreConnectionString property under the keywords "Commerce Server Manager\Global Resources\Profiles".

The Connect method must be used before loading or evaluating expressions.

The ParseXML method and the flush methods may be used without connecting to an expression store.

[Visual Basic .NET]

Example

' Connect through an existing ExpressionStore object.
oExpressionEval.Connect (oExpressionStore)

' Connect using an explicit connection string.
oExpressionEval.Connect ("Provider=SQLOLEDB;Data Source=server;" _
& "Initial Catalog=Retail_commerce;Integrated Security='SSPI'")

' Connect using a string retrieved from the SiteConfigReadOnly object.
' sConn is a String, oSCRO is an initialized SiteConfigReadOnly object.
sConn = oSCRO.Fields("Biz Data Service").Value _
 .Fields("s_BizDataStoreConnectionString").Value
oExpressionEval.Connect (sConn)

Requirements

Namespace: Microsoft.CommerceServer.Interop.Targeting

Platforms: Windows 2000, Windows Server 2003

Assembly: exprarchlib (in exprarchlib.dll)

See Also

ExpressionEvaluatorClass

ExpressionStoreClass

ExpressionStore.Connect

SiteConfigReadOnlyClass

Copyright © 2005 Microsoft Corporation.
All rights reserved.