[24hoursupport] Any programmers out there?

  • From: chizotz@xxxxxxxxx
  • To: 24hoursupport@xxxxxxxxxxxxx
  • Date: Fri, 13 Aug 2004 21:15:19 +0000

 
I have what seems to me to be a truly bizarre problem; I think it's a bug in 
the .NET 1.1 Framework, but it could be a "feature". Anyway, if there are 
any .NET programmers in the audience, I could sure use another perspective.

I'm working on a reporting application that will allow the user to use two 
date time pickers to select a start date and end date for a range to report 
on. The date range will usually be the previous week, month, or quarter based 
on the current date, but the range could be sometime last year or several 
years ago. The dates selected in the date time pickers are passed into a 
custom class I've written to obtain other information etc., but I've confirmed 
as conclusively as I can that the problem is NOT in my class but with the date 
time picker control itself.

Here's the problem. The date time pickers seem to work fine when I set the 
dates back by a month or even several. After a certain point, when I set the 
date time picker back, say, a couple of years from the date it's displaying, I 
get an error that says "Ticks must be between DateTime.MinValue.Ticks and 
DateTime.MaxValue.Ticks. Parameter name: Ticks". When I take the dates back in 
shorter spans, say a few months at a time, I can go back as far as I want 
without the error occurring. It's just when I jump back a longer span all in 
on go that the error happens.

Now, I think I have a clue what's happening, I just don't know how to fix it. 
I think that the date time picker control must have a certain range in Ticks 
that it can display, based on the date it is currently displaying. When the 
date in the control is changed, it updates the range of Ticks to the new 
values based on the new date. When the value of the control is changed to a 
date outside of that range, it errors out. Why Microsoft would put that kind 
of limit, especially one so narrow, on a control is beyond me... unless it has 
to do with liits of the underlying data type. But that's another discussion.

I've been on the web searching for answers all afternoon, and found some 
related topics but nothing that seems to really help. I would love to have my 
suspicions on what is happening confirmed, and love even more a (hopefully 
simple) way around the issue.

Thanks,

Ron


For a web-based membership management utility and information on list policies, 
please see http://nibec.com/24hoursupport/

To unsubscribe, send a blank email to 24hoursupport-request@xxxxxxxxxxxxx with 
"unsubscribe" (without quotes) in the subject.


Other related posts: