I've gotta agree with armorshell on this topic. Do we not as dentists and dental students provide preventative care, preventative oral hygiene instruction, preventative nutritional education and counseling and a number of other measures that are designed to decrease the prevalence of dental caries and periodontal disease? Look at all the dentists nationwide that advocate fluoridation of drinking water! Will you as a dentist design your restorations to fail within only a few years so you can re-treat, re-charge, and blame it all on the patient's home care just so you can increase your revenue? Or will you design your restorations to last forever and hope you never have to retreat them despite the financial gain if you do? Will you let your patient leave your office with their uneducated view of hygiene, so that when they return, and you look at all the new decay and mountains of plaque, you see dollar signs in your eyes? Or will you have regular recalls and prophies, provide detailed hygiene/nutritional education, and recommend preventative products (like fluoride rinses, Sonicare toothbrushes, Xylitol gum, etc) for your patients? If you answered yes to the first and third questions, get out of the field because you are in it for the worst of the worst reasons: to perpetuate disease in order to profit off it. It's like the mostly anecdotal theories I hear about pharmaceutical companies sweeping new and highly effective treatments/cures under the rug so that they can continue profiting off their already profitable, but limitedly successful products/treatments.
As a third (almost 4th) year student, I hate seeing people with terrible oral health conditions. Sure, it's a lot of much needed and appreciated experience for me, and in the future a gold mine of income, but I would honestly rather look at a patient and for once be able to say "Wow, Mr/Mrs So-and-so, everything looks fantastic. You've been doing an excellent job taking care of your teeth. We've got nothing to do. See you in 6 months."
But, we also have to keep in mind reality. Dentistry is NOT just treating cavities. Even if curing decay, or making it so preventable that it was a rare entity became a reality occurs in any kind of near future, there will still be plenty of necessity for the dental profession. There's trauma, there's oral surgery issues like impacted teeth and supernumeraries, there's ortho (as mentioned previously), there's staining and discoloration that may have nothing to do with disease processes, there's tooth malformation/position issues that may not be aesthetic, there's asymmetry problems, there's gingival appearance issues (like the person who has short teeth due to gingival overgrowth), there's functional issues such as grinding/clenching, there's abrasion and erosion from physical and chemical factors (over brushing, bulimia, etc), there's TMJ problems, that vain person who despite their nice looking teeth wants "perfection" in the form of veneers, and the list goes on I'm sure. The fact of the matter is, curing dental caries will not eliminate the need for qualified and educated dentists.
However, let's say there are new technologies that eliminate or greatly reduce the need for dentists. Sucks to be us from a career standpoint, but guess what? Technology replaces jobs all the time. I really get bothered by laborers that complain that there are machines now that can do what they do, and now they are out of a job. Get over it and get a new one. Why have 100 coal miners working for months with pick axes and shovels for months to do the same job a big machine can do in hours? If that happens to dentistry, we'll have to get over it and find a new path (but I doubt that will happen any time soon or even in the not so near future).
So my take? First of all, relax. Your career is not jeopardy in my opinion. Second of all, remind yourself of your obligation to prevent disease, and appreciate it.