|
.net
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
AddDays exception when subtracting valueDateTime 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. What's the initial value of SelectedDate? My guess it isn't what you
expect. Karl -- Show quoteHide quoteMY ASP.Net tutorials http://www.openmymind.net/ http://openmymind.net/redirector.aspx?documentId=51 - Learn about AJAX! "patrick" <pgo***@gmail.com> wrote in message news:1135319478.844421.113450@g49g2000cwa.googlegroups.com... >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. >
Other interesting topics
HELP: Table height in the new XHTML???
How to Remote a custom membership or profile provider ??? ASP.NET 2.0: Global.asax Design Surface Gone Populating FormView (asp.net 2.0 using vb.net) HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Word\UserData' do Unable to create the Web (W2003Std + Framework 2.0) remotely Adding domain user to local groups Where to set timeout Casting Error Quotes, tags, and "greater than" signs |
|||||||||||||||||||||||