Hello, I bought an ardduino mega 2560 and an lcd shield.I have been trying to program it but all my attemts failed. I want to ask you to send the code to me. 
Hi Andrew,
Do not desist, keep on trying, we can try to help.
In order to help you, can you share?
- The datasheet of your LCD shield. (The schematic of the shield may vary depending on the manufacturer)
- Your code
If you are using a clone board, check that there are not any difference with the schematic of the official one.
Also, other clues are usually helpful, like, what you exactly see on the LCD?, wrong character, first row on black, a cursor moving very fast...
Check all this, and we could help you to make it work!!! 
Regards,
Miguel
Okay. I'm not using any arduino clone board. I am using a pure Arduino Mega 2560 board.