storing program code in mega


everytime I turn off my computer my arduino code disappears so I have to upload it via IDE everytime i want to use it. So how to i permanantly store a program i have written into the mega.
I am using this as a midi controller via usb to my DAW computer so just want it to work without having to open up the ide and upload it everytime...I know its something to do with the bootloader but cant seem to find an easy to understand tutorial..
any help appreciated.

When you upload a sketch, the code is programmed into the flash memory, and it stays there.
Perhaps something is broken.
Is it an official Arduino Mega 2560 board ? Could you give a link to that board or make a photo of it ?

When uploading a sketch, the Arduino board is reset. What happens if you press the reset of the Arduino board ?
Do you connect the Arduino board after the computer has started ?
Could you try a simple sketch, for example blinking the led at pin 13, or sending something to the serial monitor ? Test if that will run again, even after the computer was turned off.

Try a better USB cable, perhaps the voltage for the Arduino board is too low.

everytime I turn off my computer my arduino code disappears

that's pretty literally "not possible." In order to run the sketch, it has to be uploaded into the Mega. Once it has been uploaded, it IS in "permanent" memory (the chip does not have the ability to run from non-permanent memory.)

Other things might prevent the sketch from running on power-up - errors in the program initialization, or watchdog-induced bootloader loops; all of which would be caused (at least partially) by YOUR code. Show it to us, and perhaps we can help.

This problem does come up from time to time. In every case there is something that the origional poster does not understand because this is not a real problem.

thanks for the quick response,,,and i dont know what i was doing or thinking but you are all right,,,it does store it,,sorry for wasting your time ,,,but glad to know there is help out there as it is a quite steep learning curve....thanks again