I've read that the band played hymns,but also that they stuck to upbeat music to keep from causing a panic. Who is right? (Or did they play some combination of dance and religious music?)
Also, was the entire band lost with the ship, or did any of the musicians survive?
There is debate over what the band played, including first-hand accounts, and assumptions based on appropriateness or difficulty to play given the circumstances.
Since there was no recording made, it seems impossible to know for sure. That's it. But before looking at the contenders, first, a bit of info. The eight-man orchestra was made up of Liverpool men (though one was French):
W. Theodore Brailey,
Roger Bricoux,
John Frederick P. Clarke,
Wallace Hartley,
John Law Hume,
George Krins,
Percy C. Taylor,
J. Wesley Woodward.
Who all died on the Titanic.
Suggestions for what they were playing as the ship was sinking (and remember, it took a long time), are difficult to verify due to lack of recording and a romanticism of the event since. Some of the contenders are:
"Nearer, My God, To Thee" (based on the tune "Horbury") - many personally recounted to be being performed when the band was waist high in water. Another account states the band played this tune at 2am, at least 20 minutes before the ship sank. Yet another account in May 1912 states that according to survivors, the band played "Dyke's tune" (Nearer, My God.../Horbury).
This same account says that afterwards they played the Episcopal hymn "Autumn" just before the ship disappeared.
As you said, many also remember the band playing ragtime.
The band is also remembered as playing nothing at all.
These were all by people on board the ship. Now, as for secondary sources.
It has been suggested that the "Autumn" theory is most likely as the man who observed that was a Wireless Operator and therefore trained in observation and being meticulously accurate, as well as being one of the last on board.
Some claim that "Nearer, My God, To Thee" might just be too complicated to remember in such circumstances and a simpler hymn would be more likely... hmm...
program for a concert given on the 24th of May 1912 called "The Titanic Band Memorial Concert" for the benefit of the relatives of the musicians, closed with the piece "Nearer, my God, to Thee".
It seems to me like the standout piece of music was 'Nearer, my God, to Thee'. Although, the truth is probably somewhere in the middle of all of the options. Seems one for the ages considering the conflicting accounts and unreliable memories - definitely something I'll look into more though, just for fun. There's a reason why the image has stuck with us, I think.
Norman Cryer, Stainton De B. Taylor, Betty Matthews and John Wycliffe-Jones (1973): Titanic. The Musical Times. Vol. 114, No. 1561 (Mar., 1973), pp. 259-260.