StrataFrame Forum

1/1/1800 keeps showing up...

http://forum.strataframe.net/Topic8647.aspx

By StarkMike - 5/2/2007

I have a date field in a BO that i have set to Do Not Allow Nulls... I do not have a default value specified for the field in the table. I have tried it both with the StrataFrame datepicker and the DevExpress wrapped DateEdit and when I click New it puts 1/1/1800 in the date field. I cant find where it's doing that... any suggestions?
By StrataFrame Team - 5/2/2007

It's doing it when you call NewRow() on the business object.  All of the fields within the row are initialized to blank values, which for a date, is 1/1/1800.  You can either set the AllowNullValuesOnNewRows property on the BO to false, and all of the fields will be left with DBNull.Value, or you can set the column to DBNull.Value in the SetDefaultValues() method of the business object (then, the default value of the DB will be used when the records is INSERTed).