Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

The conversion of a nvarchar data type to a datetime data type resulted in an out-of-range value
renny
#1 Posted : Wednesday, February 03, 2010 10:12:18 PM(UTC)
Rank: Advanced Member
Groups: Registered

Joined: 1/3/2010(UTC)
Posts: 50
Location: russia
Hi all,

Seems that we ran across a bug in LINQ impl.

Here is a snippet from content template:

DateTime date = DateTime.Today.AddDays(20); // 23 feb 2010
var eipRes = new ContentByCategoryNFolderQueryable((Guid)place["UUID"], "EventInPlace").Where(eip => eip.GetColumn<DateTime>("Date") > date); // here comes an exception. pasted below.

We've figured out that datetime converts to string incorrectly. Seems that you mix up days and months while parsing date,
since if date has interchangeable day and month numbers, say 01 Feb 2010, exception isn't thrown but Where returns dates after 02 Jan 2010 which is incorrect.

Please help us in resolving the issue )

Exception is shown below:

Event code: 3005 Event message: An unhandled exception has occurred. Event time: 2/25/2010 5:02:37 PM Event time (UTC): 2/25/2010 2:02:37 PM Event ID: 0d9ac8383a3b4be69e7fc44b6671d05c Event sequence: 66 Event occurrence: 6 Event detail code: 0 Application information: Application domain: /LM/W3SVC/4/ROOT-8-129115798960456927 Trust level: Full Application Virtual Path: / Application Path: C:\inetpub\wwwroot\Kooboo\ Machine name: SIRIUS Process information: Process ID: 14236 Process name: w3wp.exe Account name: NT AUTHORITY\NETWORK SERVICE Exception information: Exception type: System.Data.SqlClient.SqlException Exception message: The conversion of a nvarchar data type to a datetime data type resulted in an out-of-range value. Request information: Request URL: http://kooboo.dewave.com...=61&Date=02.03.2010 Request path: /c-Afisha/Place/ User host address: 192.168.0.233 User: Is authenticated: False Authentication Type: Thread account name: NT AUTHORITY\NETWORK SERVICE Thread information: Thread ID: 19 Thread account name: NT AUTHORITY\NETWORK SERVICE Is impersonating: False Stack trace: at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) at System.Data.SqlClient.SqlDataReader.HasMoreRows() at System.Data.SqlClient.SqlDataReader.ReadInternal(Boolean setTimeout) at System.Data.SqlClient.SqlDataReader.Read() at Everest.CmsServices.Providers.SqlServer.SqlServerTextContentQuerier.QueryContents(IEverestCmsDataContext dataContext, String queryStatement, String orderBy, IDictionary`2 queryString, Cms_Schema schema, Cms_Folder folder, IEnumerable`1 folders, Nullable`1 parentUUID, Nullable`1 referencedUUID, Nullable`1 referencingUUID, Int32 startIndex, Int32 limit, Nullable`1 cacheTime) at Everest.CmsServices.Providers.SqlServer.SqlServerTextContentQuerier.QueryReferToContents(IEverestCmsDataContext dataContext, String queryStatement, String orderBy, IDictionary`2 parameterValues, Cms_Folder folder, IEnumerable`1 folders, Guid referredByContentUUID, Int32 startIndex, Int32 limit, Nullable`1 cacheTime) at Everest.CmsServices.MvcHelper.ContentService.GetContentsByCategoryAndFolder(Guid categoryOriginalUUID, String folderName, String queryStatement, String orderBy, NameValueCollection queryValues, Int32 startIndex, Int32 pageSize, Nullable`1 cacheTime) at Everest.CmsServices.LINQ.ContentByCategoryNFolderQueryProvider.ExecuteCore(StatementExpression exp) at Everest.CmsServices.LINQ.ContentQueryProvider.ExecuteCall(Expression expression) at Everest.CmsServices.LINQ.ContentQueryProvider.Execute(Expression expression) at Everest.CmsServices.LINQ.ContentQueryable`1.GetEnumerator() at ASP.template_afisha_contenttemplate_place_list_ascx.__Render__control1(HtmlTextWriter __w, Control parameterContainer) at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) at System.Web.UI.Control.Render(HtmlTextWriter writer) at Everest.CmsServices.MvcHelper.CmsUserControl.Render(HtmlTextWriter writer) at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer) at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) at System.Web.UI.Control.Render(HtmlTextWriter writer) at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer) at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) at System.Web.UI.Page.Render(HtmlTextWriter writer) at System.Web.Mvc.ViewPage.Render(HtmlTextWriter writer) at Everest.CmsServices.MvcHelper.CmsViewPage.Render(HtmlTextWriter writer) at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)



jifeng
#2 Posted : Thursday, February 04, 2010 1:27:46 PM(UTC)
Rank: Administration
Groups: Administrators, Registered

Joined: 9/3/2009(UTC)
Posts: 1,552
Location: Xiamen China
HI

Do you set the column "Date" data type to "DateTime", could you check if the date value is valid in the database? In my test, it works fine.
Regards,

Jifeng Huang

Kooboo Team

Microsoft ASP.NET MVP
renny
#3 Posted : Thursday, February 04, 2010 10:10:33 PM(UTC)
Rank: Advanced Member
Groups: Registered

Joined: 1/3/2010(UTC)
Posts: 50
Location: russia
The bug is 100% repeatable. I attach example site template with proof: Exception replay
jifeng
#4 Posted : Friday, February 05, 2010 9:06:27 AM(UTC)
Rank: Administration
Groups: Administrators, Registered

Joined: 9/3/2009(UTC)
Posts: 1,552
Location: Xiamen China
Ok, thanks. I will check what happen on it.
Regards,

Jifeng Huang

Kooboo Team

Microsoft ASP.NET MVP
jifeng
#5 Posted : Friday, February 05, 2010 2:59:23 PM(UTC)
Rank: Administration
Groups: Administrators, Registered

Joined: 9/3/2009(UTC)
Posts: 1,552
Location: Xiamen China
HI

I have imported the example, but it works fine. I think it is culture-related. I will deep into it.
Regards,

Jifeng Huang

Kooboo Team

Microsoft ASP.NET MVP
zguoqi
#7 Posted : Friday, February 05, 2010 3:22:47 PM(UTC)
Rank: Administration
Groups: Registered, Administrators

Joined: 9/2/2009(UTC)
Posts: 692
Location: xiamen
Renny,

We understand the bug, we are fixing it now.
Regards,

Vincent

Kooboo Team
jifeng
#9 Posted : Friday, February 05, 2010 4:27:46 PM(UTC)
Rank: Administration
Groups: Administrators, Registered

Joined: 9/3/2009(UTC)
Posts: 1,552
Location: Xiamen China
We have fixed the bug. Thanks for your reporting. The new version will coming very soon.
Regards,

Jifeng Huang

Kooboo Team

Microsoft ASP.NET MVP
renny
#10 Posted : Friday, February 05, 2010 5:16:13 PM(UTC)
Rank: Advanced Member
Groups: Registered

Joined: 1/3/2010(UTC)
Posts: 50
Location: russia
Thank you for your quick response!
Please, roll the update out before Feb 13 (the date when our workaroud will be broken) :)
jifeng
#11 Posted : Friday, February 05, 2010 5:25:31 PM(UTC)
Rank: Administration
Groups: Administrators, Registered

Joined: 9/3/2009(UTC)
Posts: 1,552
Location: Xiamen China
I think it will be released early next week.
Regards,

Jifeng Huang

Kooboo Team

Microsoft ASP.NET MVP
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF 1.9.5.5 | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.362 seconds.