Casting to Decimal is not supported in LINQ to Entities queries

前端 未结 4 1569
后悔当初
后悔当初 2021-02-14 01:58

I have a database table Transaction (transactionID, LocalAmount...). where datatype for Localamount property is float. ON the UI I am trying to return a

4条回答
  •  深忆病人
    2021-02-14 03:00

    Sometimes need casting, if more than two decimal palaces

         double TotalQty;
         double.TryParse(sequence.Sum(x => x.Field("itemQty")).ToString(),out TotalQty);
    

提交回复
热议问题