I have user registration form. It has field Date of birth. It is not compulsory in database also not on UI. But while create when i am goiing to assign it to objects property, i have to convert it in to date format. But if i have not selected it, it will become null in the FormCollection object. like
User.DOB=Convert.ToDateTime(collection["DOB"]);
Now issue is if it collection["DOB"]is null then it throws exception. I can not assign default value here. So how can i handle this situation?