There is a lesson here and you may want to read this after you calmed down abit more.

The lesson is to be always well-prepared and rehearse whatever steps you are going to take during the demo beforehand. Like you said, it may make you nervous preparing so much, but I bet it felt alot more nervous when *your program* - which you've spent so much *hard work* on, didn't work as expected before a live audience.

I learnt this the hard way some years back during a very important demo. Nothing worked at all due to a glitch in the database setup, and I cried as I entered the elevator as I left the presentation room.

And just like you, right after I had some time to take a breather and find out what happened, everything just worked.

Of course you have to put it behind you and move forward, but if you don't take away the valuable lesson to be learned here, this may not be the last time a live demo will fail for you.