Click here to Skip to main content
15,896,154 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
hi,
i'm new in linq i want to convert my query to linq plz can anyone help me
this's my query

SQL
select count(distinct ID_PM),ID_STATION from STATION_PM
group by ID_STATION
Posted
Updated 20-Jul-15 20:45pm
v2
Comments
Sinisa Hajnal 21-Jul-15 2:44am    
What have you tried? Do some research, write your own Linq (this should be easy, it is a simple query). Then, if you still have trouble, post your linq, explain why do you think it doesn't work and someone will help you. Thank you.
Member 11573837 21-Jul-15 4:55am    
okey sir

1 solution

You can use by changing. Can't use groupby here
example:
var count =db.STATION_PM.Select(p=>p.ID_PM).Distinct().Count();
 
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