I wouldn't recommend it sir, its understandable that with pain, and humans (animals as well) natural tendency to shy away from it, that you would try to find a method to prevent it ever again. But what you are seeking for, some medical (approved or non approved [if it even exists]) method to remove desire for another, cannot be without its side effects. Drugs, surgery, whatnot, to disable your emotional desires for another? What, would you like somebody to surgically remove a part of your brain like in some science movie? You would likely lose much more then just abilities to get hurt, love, like, desire, etc. Castration won't help your desires for liking somebody, it'll only remove your sex drive i believe.
I cannot imagine what you have gone through, but let me tell you this, you aren't different. Whatever case you have unless it was something like 19 times cheated on, 5 of them attempted to kill you, 6 of them used you for some evil scheme, 1 of them was an alien really attempting to abduct you, or some of the most bizarre cases imaginable, you are not different. Hundreds of thousand have experienced painful events very similar and equal in magnitude as yours. And the rest of the world, both of those who have once lived and died, and those who live now, have experienced pain. But the majority of them try to move on, some get swallowed up and let the pain overtake them until it transforms them into something else, some commit suicide, some of them learn to move on. It hurts to care, it hurts to desire, to love, but pain is meant to be a way of telling you that you have done something wrong (in a very general sense). It doesn't mean that you have to never touch it again, it just means that the way in which you dealt with it was poorly misjudged. So lets say these relationship issues of yours was their "fault" and not yours, chances are, the fact that you might have experienced this many times, indicates that perhaps you didn't pick the right one wisely, you weren't reserved enough, there were signs that this relationship was a bad outcome but you ignored it, etc.
All I'm trying to say is, whether or not you want to end your sex drive is fine by all means. A person can gain true wisdom/purpose when they do not let instinctual habits get to the best of them, why do you think buddhist monks and the like are revered for having gained "enlightment" and perfectly content with their life by sacrificing their sexual desires. But to take out emotions (that aren't focused on your penis) of the heart, is inhumane, it was given to us for some unknown purpose that separates us from the other creatures in this earth. Don't be a coward and run away from them. Learn from them and remember you aren't alone.