16x2 LCD shows only black boxes in the bottom line

in my case i didn't conected the r/w to ground by connecting its working properly

You obviously have looked at some old threads but you haven't gone back far enough. The problem of not connecting the R/W line was quite prevalent several years ago but has only shown up one or twice in the past few years. The connection is clearly shown in the diagram with the tutorial (http://arduino.cc/en/Tutorial/LiquidCrystal) and is also mentioned in the program comments.

Don