The joke is a pun.  To do something 'in vain' is to be unsuccessful in ones attempts at doing something.  An I.V. is inserted into the vein of someone's arm, typically in an ambulance or hospital.
They tried to save him with an I . V . but it was all in vein .