Error in uploading the program to development Board

Sometimes the program is easily uploaded to the board but sometimes it is showing error by saying "error in uploading to the board" (like this). How to rectify this?