This project is read-only.


Error when entering dates on new sprint


Entering dates in Australian format (dd/mm/yyyy) rather than US format (mm/dd/yyyy) results in an error.

Error occurs if using the calendar drop-down tool or manually to enter a date for the Start Date or End Date
Closed Feb 19, 2016 at 2:59 PM by jacquelinewalton


Beugnen wrote Mar 5, 2015 at 1:41 AM

The error is

The conversion of a varchar data type to a datetime data type resulted in an out-of-range value.
The statement has been terminated.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: The conversion of a varchar data type to a datetime data type resulted in an out-of-range value.
The statement has been terminated.

Source Error:

Line 152: cmd.CommandType = System.Data.CommandType.Text;
Line 153:
Line 154: cmd.ExecuteNonQuery();
Line 155: }
Line 156: }

Source File: c:\Development\Crystal Test\Projects\Utilities\DatabaseUtilities.cs Line: 154

Stack Trace:

[SqlException (0x80131904): The conversion of a varchar data type to a datetime data type resulted in an out-of-range value.
The statement has been terminated.]
System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action1 wrapCloseInAction) +1767866
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action
1 wrapCloseInAction) +5352418
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) +244
System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) +1691
System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async, Int32 timeout, Boolean asyncWrite) +869
System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite) +410
System.Data.SqlClient.SqlCommand.ExecuteNonQuery() +160
Utilities.DatabaseUtilities.ExecuteQuery(String query) in c:\Development\Crystal Test\Projects\Utilities\DatabaseUtilities.cs:154
CTWebsite.Admin.AdminSprints.InsertButton_Click(Object sender, EventArgs e) in c:\Development\Crystal Test\Projects\CTWebsite\Admin\AdminSprints.aspx.cs:274
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +9633194
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +103
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +35
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1724

jacquelinewalton wrote Mar 9, 2015 at 3:54 AM

I fixed the date issue. Turns out I needed to globalize all my dates throughout the entire application. So this should work for you now and anyone in any locale. I did notice one more bug as I was getting ready to package up things and that is the system currently lets you have Sprint Begin Date larger than the End date. I didn't have time to fix that tonight so I will save that for next weekend, but I will create a ticket for it.

Thanks so much for pointing out these issues.

wrote Mar 9, 2015 at 3:57 AM

jacquelinewalton wrote Mar 9, 2015 at 3:58 AM

Please verify this works for you. Code should be done uploading soon.

jacquelinewalton wrote Mar 9, 2015 at 6:35 AM

Well I have been trying for hours to upload the code but the commit keeps failing. I have contacted codeplex. Hopefully I can get it uploaded tomorrow. Sorry for the inconvenience.

Beugnen wrote Mar 9, 2015 at 7:21 AM

No worries Jacqueline and thanks for fixing it so quickly.

Ya I don't know why Codeplex is generally so slow sometimes.

Will keep an eye out for it. Thanks!

wrote Feb 19, 2016 at 2:59 PM