Skip to Main Content

ODP.NET

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Difference between Dates / Entity Framework Core 3.1

1495799May 30 2020 — edited Jul 21 2020

Hello,

I have an exception when I try to get the difference between two dates (in Days) with the new Oracle.EntityFrameworkCore 3.19.0-beta1 NuGet package :

var row = (

        from r in dbContext.Entitites

        select new { (DateTime.Now - r.DateTimeColumn).Days }

    ).FirstOrDefault();

System.InvalidCastException: 'Specified cast is not valid.'

   at Oracle.ManagedDataAccess.Client.OracleDataReader.GetDecimal(Int32 i)

   at Oracle.ManagedDataAccess.Client.OracleDataReader.GetValue(Int32 i)

   at System.Data.Common.DbDataReader.GetFieldValue[T](Int32 ordinal)

This post has been answered by 1495799 on Aug 5 2021
Jump to Answer

Comments

Maybe issue with ADF version; check versions with something like:

unzip -p

/u01/app/oracle/middleware/oracle_common/modules/oracle.adf.share_11.1.1/adf-share-support.jar META-INF/MANIFEST.MF | grep Label

Oracle-Label: JDEVADF_something_.6493

unzip -p

/u01/app/oracle/middleware/oracle_common/modules/oracle.adf.view_11.1.1/adf-richclient-api-11.jar META-INF/MANIFEST.MF | grep Implementation

Implementation-Title: oracle.adf.view.faces

Implementation-Version: something

note that the paths are likely different in your environment and there may have been patches applied so search for the files adf-share-support.jar and adf-richclient-api-11.jar

--

Jani Rautiainen

Fusion Applications Developer Relations

1 - 1

Post Details

Added on May 30 2020
12 comments
3,390 views