What country are you in
What country did you buy the N95 from & on which network?
You do have a 3G capable SIM card? If not you'll need one.
Are you using the same SIM as the supplying network, or is it SIM free/unlocked?
Only the supplying network can provide the code, and they will charge you for it.
So you need to know the name of the company and contact them for it.
Edit: check you are not in offline mode. If definately 'online' mode, then sounds faulty and needs repairing at NSC. Cost could be anything, and can take 2-4 weeks.
Select Offline profile with your SIM car insterted (press power button briefly, thenscroll through list and select). You will see an X top left of screen, and OFFLINE where your network name should be.
Next change the phone back to General. You will get a message to say "Currently offline, change profile and allow connections?" Select YES.
You can also make sure your phone is in Dual or GSM mode (IIRC NON US phones can't use US 3G/UTMS due to different frequencies). This is under settings & network. While you're in there, make sure network selection is either auto, or use manual and select t-mobile.