DJ메탈짱™의 Free Style

[C#] LINQ to SQL(Sum) 본문

일(job)/MS(Microsoft)

[C#] LINQ to SQL(Sum)

뽀&쏭 2015. 12. 8. 12:20


// 2011/07/13 - LINQ query (SUM)

var tSum =

from p in db.TBSimulation    // fromy

where p.USERID == this.hdUSERID.Text

                && p.GROUPID == "A"     // wherey

select p.RESULT;             // selecty

           

        // Total Profit

        this.lblTPROFIT.Text = tSum.Sum().ToString();