Author: bryanlemmer | Posted on: 12/3/2008 5:56:26 AM | Views : 435

 Hi guys,
I want to do some data conversions checkson my fields in properites. I want to set all int values to -1 if they fail the convert and all dates to null. I can get the ints to work but not the datetimes. here is my property
 
public DateTime DOB
{
//get { return _DateOfBirth; }
set
{
try
{
_DateOfBirth = (DateTime)value;
//_DateOfBirth = DateTime.Parse(value);
}
catch (InvalidCastException)
{
_DateOfBirth = null;
}
}
}If you can point me in the right direction it will ...

Go to the complete details ...