I have string field that is nullable in the database. In my BO I have AllowNullValuesOnNewRow set to True. In the BO Custom Field Properties I have Return Alternate on Null with the value being String.Empty. When a new row is created I don't set a default value for this field.
Ok - now here's the problem. When I create a new row and don't touch that field a Null is saved to the database (good). However, if I put something in that field and then blank it out then "" (empty string) is saved to the database (bad).
If I have an existing record with a value in the field and I blank it out it is also saved as an empty string when, in fact, I really want it saved as a Null.
Try as I may I just can't find the magic settings to achieve nulls. How do I go about saving null values instead of empty strings.
Cheers, Peter
While my question is specific to string fields I also have date fields that I needs to be able to save as nulls. I pretty sure all our numeric fields default to zero.
The Set NULL on Alternate also works for reference types (INTs, FLOATs, etc.).
Thanks for that - in retrospect I can't believe I didn't try Return and Set.