ExecuteScalarAsType Method
Definition
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
statementDataStatementThe command statement to execute.
returnTypeTypeThe type to return the first column value as.
setupAction<ObjectFormattingOptions>The ObjectFormattingOptions which needs to be configured.
Returns
- object
The first column of the first row in the result from
statementas the specifiedreturnType.