Execute an IDbCommand (that returns a 1x1 resultset and takes no parameters) against the provided IDbConnection.
Namespace: CodeSmith.EngineAssembly: CodeSmith.Engine (in CodeSmith.Engine.dll) Version: 6.0.0.0 (7.0.0.15127)
Syntax
C# |
---|
public virtual Object ExecuteScalar(
IDbConnection connection,
CommandType commandType,
string commandText
) |
Visual Basic |
---|
Public Overridable Function ExecuteScalar (
connection As IDbConnection,
commandType As CommandType,
commandText As String
) As Object |
Return Value
Type:
ObjectAn object containing the value in the 1x1 resultset generated by the command
Examples
| Copy |
---|
int orderCount = (int)helper.ExecuteScalar(conn, CommandType.StoredProcedure, "GetOrderCount"); |
Exceptions
See Also