As a writer, you can't allow yourself the luxury of being discouraged and giving up when you are rejected, either by agents or publishers. You absolutely must plow forward.