It's on SP. James Hamilton married Marion Penicuik on 11 July 1851 in Newbattle.
There three children in the records
William, born 16 September 1852, Cockpen, died 1855, Cockpen
James, born 8 September 1856, Inveresk and Musselburgh
Helen Porteous, born 24 May 1860.
Armed with this information, the 1861 census shows them in Dalkeith:
James Hamilton, 29, born Duddingston
Marion Hamilton, 38, born Cockpen
James Hamilton, 5, born Inveresk
Helen Hamilton, under 1 year, born Dalkeith.
I have not found him in 1851 or 1841.
He said that he was 29 on census day. If that is accurate he was born between 31 March 1828 and 30 March 1829, so he's more likely to have been born in 1828 than in 1829. However there is no surviving record of his baptism on the Scotland's People web site.
There is an outside chance that he might have been baptised in some minor denomination, and that the record of that baptism, if it ever existed, might have survived and be lurking somewhere in a forgotten tome on a dusty shelf, but realistically the chances of finding it are minimal.
He might perhaps have been illegitimate, and if so there might be some reference to him in the Duddingston Kirk Session minutes, which can be consulted at Scotland's People.