P
patrick
I have the following code in ASP.NET 2.0 (C#)
DateTime datStartDate;
datStartDate = calMonth.SelectedDate; //calStart is a calendar
control
datStartDate = datStartDate.AddDays(-6);
and it gives me the following error:
System.ArgumentOutOfRangeException was unhandled by user code
Message="The added or subtracted value results in an un-representable
DateTime.\r\nParameter name: value"
Source="mscorlib"
ParamName="value"
StackTrace:
at System.DateTime.AddTicks(Int64 value)
at System.DateTime.Add(Double value, Int32 scale)
at System.DateTime.AddDays(Double value)
at Controls_diaryweek.Page_Load(Object sender, EventArgs e) in
c:\Documents and Settings\Padraig\My Documents\Visual Studio
2005\WebSites\TheFitnessDiary\Controls\diaryweek.ascx.cs:line 18
at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp,
Object o, Object t, EventArgs e)
at
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender,
EventArgs e)
at System.Web.UI.Control.OnLoad(EventArgs e)
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
BTW - adding a positive number of days works fine.
Any ideas would be appreciated!!
Thanks,
Patrick.
DateTime datStartDate;
datStartDate = calMonth.SelectedDate; //calStart is a calendar
control
datStartDate = datStartDate.AddDays(-6);
and it gives me the following error:
System.ArgumentOutOfRangeException was unhandled by user code
Message="The added or subtracted value results in an un-representable
DateTime.\r\nParameter name: value"
Source="mscorlib"
ParamName="value"
StackTrace:
at System.DateTime.AddTicks(Int64 value)
at System.DateTime.Add(Double value, Int32 scale)
at System.DateTime.AddDays(Double value)
at Controls_diaryweek.Page_Load(Object sender, EventArgs e) in
c:\Documents and Settings\Padraig\My Documents\Visual Studio
2005\WebSites\TheFitnessDiary\Controls\diaryweek.ascx.cs:line 18
at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp,
Object o, Object t, EventArgs e)
at
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender,
EventArgs e)
at System.Web.UI.Control.OnLoad(EventArgs e)
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
BTW - adding a positive number of days works fine.
Any ideas would be appreciated!!
Thanks,
Patrick.