Click here to Skip to main content
16,017,261 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
SQL
Select * from Temp

----------------------
this is in database
---------------------------------------------
PlateName PlateType  Qty   Cost Rate    Machine
---------------------------------------------
P.S	Medium	4	1600.00	400.00	SM101
P.S	Short	4	1600.00	400.00	SM101
P.S	Short	4	1600.00	400.00	SM101
P.S	Short	4	1600.00	400.00	SM101
P.S	Short	4	1600.00	400.00	SM101
P.S	Short	4	1600.00	400.00	SM101
CTP	Short	4	1200.00	300.00	SM101
CTP	Short	4	1200.00	300.00	SM101
CTP	Short	4	1200.00	300.00	SM101
CTP	Short	4	1200.00	300.00	SM101
CTP	Short	4	1200.00	300.00	SM101
---------------------------------------------

SQL
SELECT PlateName, PlateType, sum(Qty) Qty, sum(Cost) Cost, Rate, Machine
FROM TempPlates WHERE PlateType='short'  and  PlateName='P.S'
GROUP BY Rate,Machine,PlateType,PlateName

Result of this is Query is
PlateName PlateType  Qty   Cost         Rate    Machine
-------------------------------------------------
P.S	  Short	     20	  8000.00	400.00	SM101
-------------------------------------------------


I need to convert this querry into Lamda Expression(LINQ) for same result

thank in advance...!!
Posted
Updated 13-Jan-12 1:27am
v3

You don't need to convert this to a Lamda Expression. You need a LINQ query. Please learn to difference.

There are plenty of examples here LINQ Query Samples[^]
 
Share this answer
 
LINQPad[^] has a lot of examples too.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900