Microsoft didnt think something through..

cjard

Well-known member
Joined
Apr 25, 2006
Messages
7,081
Programming Experience
10+
I have a parent/child relationship, where the child has a date column
On my form, a datetimepicker is bound to this column

If I fill the tables in the correct order: Parent, then Child (when constrained each child row must have a parent row so parents must be loaded first)
Then the following exception arises when filling the *parent*:
ArgumentOutOfRangeException: Value of '01/01/0001 00:00:00' is not valid for 'Value'. 'Value' should be between 'MinDate' and 'MaxDate'.
As far as I can tell, this is caused by the relationship to the child table (which at this point has 0 rows) because when the DTP is unbound from the child, the exception does not arise. Presumably an event fires a change that makes the dtp want to update its value. Upon not finding a value, it's getting this wildly out of range date of year 0001 from somewhere.

If I fill the tables in the inverse order: Child, then Parent
Then the exception does not arise when filling

Regardless of the order, the exception arises when clearing the dataset


-

If anyone else ever found this, did you find a solution?
 
some page I just saw on the Tinternet had the same issue. although there was no solution posted, the guy who posted the problem said it didn't happen when he bound to the text field instead of the value field....

Not sure whether that helps, I'm just trying to be helpful. don't normally see you posting a question on here ;)
 
Back
Top