I have an entry where I need to enter a date (MM/DD/YYYY). I have a validator to make sure the date is entered correctly. The SQL data type is smalldatetime which adds a time to the date. If I enter "2/15/2007" into the entry, the data that is saved it "2/15/2007 12:00:00 AM." Which, I read through the forums to see that there's no easy way to fix that so I was just going to allow it to happen (I dont want it there). On my gridview, where I view all the entered data, I put a comparevalidator to validate the entry to make sure the date is in the correct format. This is where the kicker is. The validator wont allow the update if the entry has a time. Therefore, if I have to update, I have to erase the time portion of the entry. If I have an entry "2/15/2007 12:00:00 AM " and hit update, then I have to erase the "12:00:00 AM" portion of the entry before the update is allowed.
Is there a way to get rid of the time portion of the entry for good?
How do I fix the validator to validate "2/15/2007 12:00:00 AM" or "2/15/2007"?