Hi
sometimes it just happens and there is nothing we can do. Other then checking the water perimeters, making sure it wasn't attacked by an uncombatible tankmate, checking to see if it had any physical symptoms like Ich or fungus and using meds accordingly, or making sure the water temp* is where it should be, there isnt much else to do. Have you tested your water to see what the ammonia and nitrate, nitrite levels are in the tank? Have you checked to see if there is any physical evidence of disease on the body? Gasping for air can be a lot of things, stress or water quality. Did your barb change color or go real pale? How often do you do water changes? Is it a cycled tank?
Anyway its frustrating to loose fish when you think all is well in the tank. Sorry to hear it.
GO RED SOX!!! 