They're both correct. However, I think it might be better to say わたしのともだちのたなかさん for the first sentence. The only reason I say this is because all the example sentences that I've found using "tomodachi + no + friend's name" have had わたし or あなた before it. Someone else maybe be able to confirm whether or not this is needed though.
私の友達のボブを覚えてる?
watashi no tomodachi no Bobu wo oboeteru?
Do you remember my friend Bob?
僕の友達のロバートはいいやつなんだ
boku no tomodachi no Robaato ha ii yatsu nan da
My friend Robert is a good guy