Disable 3G/2G Data transfer in Android 2.1

It was bugging me that my phone eats out my allowance all the time using data connection.
It did that even when I disabled applications background data transfer.

I was looking for a feature allowing to disable 3G and 2G data connections allowing WiFi only.
When I was buying the phone I thought there is a setting allowing to do that.
Unfortunately, there is not (or at least I could not find any).

However, there is a workaround using a hidden menu at least in Android 2.1:

1. Dial *#*#4636#*#* (to easy to remember 4636 is INFO on a keypad)
2. Select “Phone Information”
3. Press “Menu” button (top left one on my phone)
4. Select “More”
5. Select “Disable Data on Boot” or “Disable Data Connection” or both.
5a. Reboot your phone if you selected “Disable Data on Boot”

The data connection symbol should disappear from the top bar.

To enable data connection just go to this menu and enable the disabled features.

NOTE: There is one caveat: data connection will be enabled again after you use WiFi.
In that case you have to disable data connection again.