Calling Stored Procedures that Return a Scalar Value

To run a stored procedure that returns a scalar value, use one of the ExecSprocScalar methods.

  • Executes the specified stored procedure in the specified database, passing the specified parameters and returning a scalar value

    protected virtual object ExecSprocScalar(string sprocName, string databaseKey,
    	params IDbDataParameter[] dataParams)

    For example:

    bool userExists = (bool)this.ExecSprocScalar("UsersUserIDExists"this.CreateParameter("@UserID", userID));
    

  • Executes the specified stored procedure in the default database, passing the specified parameters and returning a scalar value

    protected virtual object ExecSprocScalar(string sprocName, params IDbDataParameter[] dataParams)
    

  • Executes the specified stored procedure in the default database without parameters, returning a scalar value

    protected virtual object ExecSprocScalar(string sprocName)
    


© (c) 2026 Oak Leaf Enterprises, Inc., 1996-2026 • Updated: 07/28/18
Comment or report problem with topic