This reply may be redundant, but yes everyone is right on the money with water damage and dock connector issues causing this problem. Definitely check your dock connector for pocket lint compacted down in it. I have seen iPhones with so much fuzz jammed into the dock port that the power charger won't even lock into place properly! If you get a little moisture on this "lint jam" it can short your connector.
Unfortunately, it is nearly impossible to replace a dock connector on a 2G because it is so intertwined with the midframe and also requires removal of top glass and LCD because the flex assembly is also part of the home button. (Man I'm glad Apple changed this design with the 3G!) You'll likely damage more stuff trying to replace a dock connector on a 2G than it's worth.
I suggest buying the entire 2G top glass/midframe assembly (provided of course you don't have water damage evident on the logic board) I've used this unit from Hong Kong for $98.00US (free shipping) a few times(Cosmax I believe is the company name and expect 14 days for delivery). It makes easy work of just about any 2G repair since all you're going to use from the broken phone is the logic board, camera, aluminum back housing with head phone/button flex assembly and the black plastic outer antenna cover.