You must Sign In to post a response.
  • Category: LINQ

    How to get sum of two in linq query

    I need to check sum(col1+col2+col3) = 100 in linq
  • #759317
    Hello Ashok,

    Refer the linq query for example :

    var result = tblSystems.GroupBy (s => 1).Select (s => new
    {
    val1 = s.Sum (x => x.fkInfoSubCatID),
    val2 = s.Sum (x => x.fkCompanyID),
    val3 = s.Sum (x => x.eventResult)
    });

    Hope this will help you.
    Mark the answer if it helped you.

    Regards,
    Nirav Lalan
    DNS Gold Member
    "Failure is the path of least persistence"


  • Sign In to post your comments