You can't prevent an error. Obviously if you try to turn "acbxyz" into a
date you will get an error.
You need to catch it in a try...catch block.
A better way might be to test prior to calling Parse to see if your value is
an empty string, then just don't call Parse.
"Paul Beckett" <pa**********@lineone.net> wrote in message
news:c1**********@hercules.btinternet.com...
Does anyone know how to prevent an error when using DateTime.Parse?
I am using it to format the display of dates in my database. However, some
dates are empty and so I get an error when I try to run my webpage.
Help please!!
paul Beckett