ERROR ON:  numApprovals = (int)cmd.ExecuteScalar();
    public static int AwaitingApprovals()
    {
        int numApprovals = 0;
        string sql = "SELECT COUNT(Type) AS OpenforApproval FROM dbo.LeaveRequest WHERE Type IN (2, 3, 4, 5, 6, 8, 13, 14, 16, 22)GROUP BY MgtApproval HAVING (MgtApproval IS NULL";
        //"SELECT COUNT(EffectiveDate) AS OpenforApproval FROM LeaveRequest GROUP BY TimeStampApproval HAVING (TimeStampApproval IS NULL)";

        using (cn = new SqlConnection(ConnectionString()))
        {
            cn.Open();
            using (cmd = new SqlCommand(sql, cn))
            {
                cmd.CommandType = CommandType.Text;
                numApprovals = (int)cmd.ExecuteScalar();
            }
        }

        return numApprovals;
    }
ERROR ON:  numApprovals = (int)cmd.ExecuteScalar();
===

    public static int AwaitingApprovals()
    {
        int numApprovals = 0;
        string sql = "SELECT COUNT(Type) AS OpenforApproval FROM dbo.LeaveRequest WHERE Type IN (2, 3, 4, 5, 6, 8, 13, 14, 16, 22)GROUP BY MgtApproval HAVING (MgtApproval IS NULL";
        //"SELECT COUNT(EffectiveDate) AS OpenforApproval FROM LeaveRequest GROUP BY TimeStampApproval HAVING (TimeStampApproval IS NULL)";

        using (cn = new SqlConnection(ConnectionString()))
        {
            cn.Open();
            using (cmd = new SqlCommand(sql, cn))
            {
                cmd.CommandType = CommandType.Text;
                numApprovals = (int)cmd.ExecuteScalar();
            }
        }

        return numApprovals;
    }