DotNetSolutions
Monday, April 15, 2013
Linq groupby in c#
public void LinqGroupby()
{
List<Product> products = GetProductList();
var groupby=
from p in products
group p by p.Category into g
select new { Category = g.Key, Products = g };
gridview1.datasource=
groupby
;
gridview1.databind();
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment