Mike,You need to return some type of alternate value when you have a field that will support NULL values, this way you can avoid this error. You can use a nullable generic or just returned a specified value when the value is DBNull. To do this you will need to do the following:
- Open up the BO Mapper and navigate to your business object.
- Select the DeferredTo field and click "Customize." This will bring up the Custom Field Properties.
- Under NULL Value Support, select "Use Nullable Generic" and then click OK.
- Rebuild your partial class by using the Context Menu on the one BO that you just modified or click the "Rebuild All" button.
- Run your application and the error should be gone.
You could also return an alternate value by selecting the "Return Alternate On Null" and then setting the "Null Replacement" value to #01/01/1800#
FYI: All StrataFrame controls will respect #01/01/1800# as a NULL value so you can clear out the contents of a DateTime field by setting the ClearOnNull property. If you do not want to use 01/01/1800 as the null date, you can set it to whatever you like and then set the NullDateValue property on the DateTimePicker to the date you prefer to use a "null".
Hope this helps.