DateTimeOffset support

Discussion of open issues, suggestions and bugs regarding LinqConnect – Devart's LINQ to SQL compatible ORM
Post Reply
Audacity
Posts: 2
Joined: Fri 11 Jan 2013 18:33

DateTimeOffset support

Post by Audacity » Fri 11 Jan 2013 18:37

Does LinqConnect for SQL Server support DateTimeOffset data types?

I'm evaluating LinqConnect, and when querying my database with LinqConnect I none of my LINQ queries that contain DateTimeOffset values work when using LinqConnect. These queries had previously worked with Microsoft's LINQ to SQL.

If I remove the DateTimeOffset column from the query using LinqConnect, the query starts working. This is what lead me to ask this question.

Audacity
Posts: 2
Joined: Fri 11 Jan 2013 18:33

Re: DateTimeOffset support

Post by Audacity » Sat 12 Jan 2013 20:53

We've reproduced this problem using an absolute minimum test. Console Windows application. Database consisting of a single table: id column, DateTimeOffset column. This query:

context.Table1s.Where(r => r.Date > DateTimeOffset.Now).FirstOrDefault();

It results in the same error I was finding with the other solution:

Cannot use "DateTimeOffset" type value in "DateTimeOffset" type argument

Stack trace:
System.NotSupportedException was unhandled
HResult=-2146233067
Message=Cannot use "DateTimeOffset" type value in "DateTimeOffset" type argument
Source=Devart.Data.Linq
StackTrace:
at Devart.Data.Linq.Engine.DbMethodCallConverter.CheckConversionToParameterType(SqlExpression argumentValue, Type parameterType)
at Devart.Data.Linq.Engine.DbMethodCallConverter.a(aa A_0)
at Devart.Data.Linq.Engine.SqlVisitor.a(SqlNode A_0)
at Devart.Data.Linq.Engine.SqlVisitor.c(SqlExpression A_0)
at Devart.Data.Linq.Engine.SqlVisitor.f(SqlSelect A_0)
at Devart.Data.Linq.Engine.DbMethodCallConverter.a(SqlSelect A_0)
at Devart.Data.Linq.Engine.SqlVisitor.a(bg A_0)
at Devart.Data.Linq.Engine.DbMethodCallConverter.a(bg A_0)
at Devart.Data.Linq.Engine.SqlVisitor.a(SqlNode A_0)
at Devart.Data.Linq.Engine.do.a(SqlNode A_0, al& A_1)
at Devart.Data.Linq.Engine.do.d(Expression A_0)
at Devart.Data.Linq.Engine.do.f(Expression A_0)
at Devart.Data.Linq.DataProvider.b(Expression A_0)
at Devart.Data.Linq.Engine.DataQuery`1.h()
at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
at TestLinqConnect.Program.Main(String[] args) in c:\Users\xxx\source\Projects\TestLinqConnect\TestLinqConnect\Program.cs:line 15
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException:

This seems like a rather odd error message. Note that the DateTimeOffset column was also NOT NULL just to try to make the test as simple as possible.

MariiaI
Devart Team
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

Re: DateTimeOffset support

Post by MariiaI » Mon 14 Jan 2013 08:01

Thank you for the report. This is a known issue. We are investigating it now and we will inform you about the results as soon as possible.

MariiaI
Devart Team
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

Re: DateTimeOffset support

Post by MariiaI » Wed 16 Jan 2013 10:58

The bug with using DateTimeOffset in 'Where' statements has been fixed. The fix will be included in the next build of LinqConnect. We will inform you when it is available for download.

MariiaI
Devart Team
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

Re: DateTimeOffset support

Post by MariiaI » Fri 18 Jan 2013 08:03

New build of LinqConnect 4.1.169 is available for download now!
It can be downloaded from http://www.devart.com/linqconnect/download.html (trial version) or from Registered Users' Area (for users with valid subscription only).
For more information, please refer to http://forums.devart.com/viewtopic.php?f=31&t=25663

Post Reply