I concur with replacing the pan as the ultimate solution, but if you're looking to buy some time for now (as I am!) JB weld is great stuff.
Many auto parts stores also sell a product made especially for oil pan pinholes; I used one that included a small, adhesive fibreglass screen, and a compound like JB Weld was then put on overtop of the screen. Worked / is working great, but I recognize that it's just a matter of time before another pinhole appears.
My pinhole was closer to the top of the pan, and it shot oil right on to my exhaust.