How do we prevent such tragedies in the future? It is plainly obvious that the guns used were solely to blame for all the deaths.
First, immediately pass laws banning the possession of any type of gun, except by military or police. To make certain even these weapons cannot commit mass murders, only guns capable of holding a single bullet at a time will be allowed. All gun stores will be closed down and their inventory taken away to be destroyed. Gun manufacturers in the United States will be forced to close their doors, and their employees put out of work. All persons with a gun must immediately take it to a police station to be turned in. The police, Army and National Guard will be given the right to search any person or their property at any time for illegal guns. This is in the interest of children's safety, so no legal challenges are allowed.
Second, just on the slight chance that the shooter was emotionally unstable, every person over age 13 must undergo a psychiatric evaluation as soon as possible, and at least once a year thereafter. Anyone exhibiting behavior outside of the "norm" will immediately be detained. Since it would be difficult to examine everyone in a short time, the public would be required to report any person showing anti-social tendencies. These persons would be arrested as a potential threat to society and held until they receive a full examination. Again, because this to protect children, all rights to due process under the law will be suspended.
If this sounds ridiculous, think about it before allowing knee-jerk reactions to what happened in Connecticut. I don't have the answer, but the scenarios above are certainly not it either.