Skip to content

SqlHelper.ExecuteScalar method (1 of 2)

Executes the statement returning a scalar value.

public static object? ExecuteScalar(IDbConnection connection, SqlQuery query, 
    ILogger? logger = null)
parameter description
connection The connection.
query The select query.
logger The logger.

Return Value

The scalar value.

Exceptions

exception condition
ArgumentNullException selectQuery is null.

See Also


SqlHelper.ExecuteScalar method (2 of 2)

Executes the statement returning a scalar value.

public static object? ExecuteScalar(IDbConnection connection, string commandText, 
    IDictionary<string, object?>? param = null, ILogger? logger = null)
parameter description
connection The connection.
commandText The command text.
param The parameters.
logger The logger.

Return Value

The scalar value.

Exceptions

exception condition
ArgumentNullException connection is null.

See Also