Mark Tabor

Mark Tabor

  • 555
  • 1.9k
  • 432.2k

Getting exception cast to a value type system.decimal

Aug 25 2022 8:23 AM

Dear I have the following query in which I am calling a view in oracle it gives the below exception I could not get on which column it is giving an exception my view contains three tables with joins

The cast to value type 'System.Decimal' failed because the materialized value is null. Either the result type's generic parameter or the query must use a nullable type

MY QUERY IS HERE EmployeeID is coming from method 

var EmployeeInDB = (from vvv in db.NTH_VIEW_INFO

                                         where vvv.EmpID== EmployeeID

                                         select vvv).FirstOrDefault();


Answers (1)