D
David
Hi,
Sample query... how do I write it in linq?
SELECT UserName, COUNT(UserName) AS Expr1
FROM aspnet_Users
WHERE (LastActivityDate BETWEEN '23 March 2009' AND '10 April 2009')
GROUP BY UserName
I have tried...
var users = from Users in dc.aspnet_Users
where Users.LastActivityDate >= "23 March 2009"
where Users.LastActivityDate <= "10 April 2009"
group Users by Users.UserName into g
select new
{
Key = g.Key, Count = g.Count()
};
but it doesn't work. (problem with >= and <=)
I am new to linq (still attempting to get my head around it). I am not even
sure if g.Key and g.Count() are what I am looking for. All I know is I want
to be able to return a resultset like the sample query.
--
Best regards,
Dave Colliver.
http://www.AshfieldFOCUS.com
~~
http://www.FOCUSPortals.com - Local franchises available
Sample query... how do I write it in linq?
SELECT UserName, COUNT(UserName) AS Expr1
FROM aspnet_Users
WHERE (LastActivityDate BETWEEN '23 March 2009' AND '10 April 2009')
GROUP BY UserName
I have tried...
var users = from Users in dc.aspnet_Users
where Users.LastActivityDate >= "23 March 2009"
where Users.LastActivityDate <= "10 April 2009"
group Users by Users.UserName into g
select new
{
Key = g.Key, Count = g.Count()
};
but it doesn't work. (problem with >= and <=)
I am new to linq (still attempting to get my head around it). I am not even
sure if g.Key and g.Count() are what I am looking for. All I know is I want
to be able to return a resultset like the sample query.
--
Best regards,
Dave Colliver.
http://www.AshfieldFOCUS.com
~~
http://www.FOCUSPortals.com - Local franchises available