Wednesday 15 May 2013

.net - SQL Query To Linq or Lambda Expression -


I am surprised to create an equivalent linq or lambda expression for the following SQL query statement:

 < Select a code (zodiac (a.credit) - zodiac (a.debit)) as an enclosure table_a from the total table_a a.accountid = b.id where a. [Date] & gt; = '2013-01-01' and one. [Date] & lt; '2013-03-27' and 'b' name = 'mkbank'   

Any help is appreciated.

This should work:

  var qr = in a LA By joining, B.Id equals at a.Id in l, where a.Date & gt; = New Date Time (2013, 1, 1) & amp; Amp; A.Date & lt; New date time (2013, 3, 7) & amp; Amp; Select B.Name == "MkBank" new {cr = a.credit, db = a.debit}; Var res = qr.Sum ((x) => x.cr - x.db);    

No comments:

Post a Comment