Alex Rivera | Logout

Return a count with linq-to-sql

Asked 2009-08-10T14:20:42.770
13

I want to return a count of new users since a specific date.

Users table has: UserID, username, dateJoined.

SELECT COUNT(USERID)
FROM Users
where dateJoined > @date

How would this look in linq-to-sql?

Can you use the keyword COUNT?

Edit
Report

1 Answer

2
(from u in context.Users where u.dateJoined > date select u).Count()
answered 2009-08-10T14:25:11.703

Your Answer