I thought I'd replied but it didn't seem to post
Anyway, what I said was although I can't really offer any advice as I've never been in a relationship, what I do know is that while rejection hurts, it doesn't have to be about you. You can do everything right and not be going wrong, but people are crazy complicated who often don't know who or what they want, realise too late or never, or sometimes circumstances just aren't right.
I know it doesn't change the hurt but don't tell yourself you're "going wrong" because there is no right and wrong with this stuff. Everyone is 'hopeless' at it until it works out, and then they're not.