Possible bug ? Nullable timestamps compared

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
rbkantor
Posts: 3
Joined: Tue 12 Jun 2012 21:03

Possible bug ? Nullable timestamps compared

Post by rbkantor » Tue 31 Jul 2012 21:52

I have created a simple oracle table ( TESTTABLE ) with ID ( number, primary key, can not be null ) and TIME ( timestamp(6), can be null )

Attempts to read contents of the table using linqConnect are failing, for

var aa = (from a in context.TESTTABLEs
where a.TIME.GetValueOrDefault().AddDays(1) > DateTime.UtcNow
select a).FirstOrDefault();

I am getting exception

The argument 'value' was the wrong type. Expected 'System.DateTime'. Actual 'System.Nullable`1[System.DateTime]'.

If TIME can not be null, there are no problems.

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

Re: Possible bug ? Nullable timestamps compared

Post by MariiaI » Wed 01 Aug 2012 10:56

Thank you for the report. We have reproduced this issue. We will investigate it and notify you about the results as soon as possible.
As a workaround, you could try re-writing your query as follows:

Code: Select all

var aa = (from a in context.TESTTABLEs
where a.TIME.Value.AddDays(1) > DateTime.UtcNow
select a).FirstOrDefault();
Please inform us whether this helps.

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

Re: Possible bug ? Nullable timestamps compared

Post by MariiaI » Fri 10 Aug 2012 06:13

The bug with nullable timestamps is fixed.
New build of dotConnect for Oracle 7.1.58 is available for download now!
It can be downloaded from http://www.devart.com/dotconnect/oracle/download.html (trial version) or from Registered Users' Area (for users with active subscription only).
For more information, please refer to http://forums.devart.com/viewtopic.php?f=1&t=24670

Post Reply