Table of Contents

ExecuteScalarAs Method

Definition

Namespace
Cuemon.Data
Assemblies
Cuemon.Data.dll
Source
src/Cuemon.Data/DataManager.cs

ExecuteScalarAs<TResult>(DataStatement, Action<ObjectFormattingOptions>)

Executes the command statement, and attempts to convert the first column of the first row in the result set to the specified TResult. Additional columns or rows are ignored.

public virtual TResult ExecuteScalarAs<TResult>(DataStatement statement, Action<ObjectFormattingOptions> setup = null)

Parameters

statement DataStatement

The command statement to execute.

setup Action<ObjectFormattingOptions>

The ObjectFormattingOptions which may be configured.

Returns

TResult

The first column of the first row in the result from statement as TResult.

Type Parameters

TResult

The type of the return value.

Remarks

This method uses InvariantCulture when casting the first column of the first row in the result from statement.

Exceptions

AggregateException

The first column of the first row in the result set could not be converted.

See Also