StrataFrame Forum

Odd Date Behavior...

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

By StarkMike - 5/25/2007

I used to use #1/1/1800# as my null date replacement. I've since removed this from the BO Mapper and rebuilt all my BOs. However when I create a new record through my form 1/1/1900 still pops up... any idea why?
By Trent L. Taylor - 5/25/2007

It is possible that the date that was previously serialized within the forms designer for the date time picker.  If you select the control within the form designer, what is the date set to?
By StarkMike - 8/2/2007

Ok, so I'm still trying to figure this one out. Here's what I did.



I created a new table in SQL Server with just one field. A smalldatetime field set to Allow Nulls but no default value.



I created a new StrataFrame project and a new project inside the BO Mapper. I created a new BO and bound it to the new table I created. No customizations on the field.



I dropped the new BO on the form and a BBS. I bound a native DatagridView to the BBS which was bound to the BO. I created only one fill method :



Public Sub Fill()

Try

Me.FillDataTable("SELECT * FROM Table_1")



Catch ex As Exception



End Try





And yet when I add a new record using the grid there is still a default value of 1/1/1900 inserted. I have no idea where it comes from.



On the other hand I created a pure .NET app using native .NET data sources and when I added a record it didnt insert 1/1/1900. I'm stumped. I'm including a screenshot of my native .NET app in case you have questions about how I setup this project.
By Trent L. Taylor - 8/2/2007

I'm stumped.

Me too Smile  We do not use 1/1/1900 as a default anywhere.  But I believe, so don't be discouraged Smile  .... however :errm: I cannot reproduce your behavior.  I just followed your steps from above and when I create a new row, it appears as 1/1/1800.

I think that is the first mystery that we need to resolve.  I think that if we clear that up then the rest is downhill.  Smile

By StarkMike - 8/2/2007

I agree that if you solve the mystery of 1/1/1800, 1/1/1900 will solve itself.

Here are a couple of links that may or may not help. I havent had too much time to study it, but it sounds like it may be a SQL Server issue.

http://www.codescene.com/2006/01/party_like_its_111900_or_how_t.php

http://www.dotnet247.com/247reference/msgs/15/79000.aspx

I appreciate all the help. ;-)

By StarkMike - 8/16/2007

Any progress on this? Cool
By Trent L. Taylor - 8/16/2007

Actually I did not know you were waiting on me.  I thought you were going to look into the dates on your side.  This should not have anything to do with SF, but if you can give me a sample that reproduces the behavior I will look at it.  I am curious. Smile