Table of Contents

ExecuteScalarAsType Method

Definition

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

ExecuteScalarAsType(DataStatement, Type, Action<ObjectFormattingOptions>)

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

public virtual object ExecuteScalarAsType(DataStatement statement, Type returnType, Action<ObjectFormattingOptions> setup = null)

Parameters

statement DataStatement

The command statement to execute.

returnType Type

The type to return the first column value as.

setup Action<ObjectFormattingOptions>

The ObjectFormattingOptions which needs to be configured.

Returns

object

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