Here is Simple Code for understanding Group By in LinQ.
// Group by With Linq
// Group by With Linq
List<string> ls = new List<string>();
using (LinqModel.LinqEntities ST1 = new LinqModel.LinqEntities())
{
var V = (from State in ST1.State_Master
group State by State.CountryID into temp
select new
{
T1 = temp.Key.Value,
T2 = temp
}).ToList();
foreach (var c in V)
{
for (int i = 0; i < c.T2.ToList().Count; i++)

Mukesh Kumar TiwariPosted Apr 29, 2014, 7:52 AM
Good........