Issue

When using the ExecuteScalar method to execute a SmartObject from SmartObjectClient API, an error occurs as below.

"Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index"

Symptoms

This error appears when call ExecuteScalar is followed by ExecuteList in sequence within a SINGLE SmartObjectClientServer connection.

Image

Troubleshooting Steps

A workaround for this is to create a new SmartObjectClientServer connection for each ExecuteScalar and ExecuteList call.