LINQ

get items count by month  from list

Solution :
 var ItemsDetails = (from p in lc
                                             where (p["Issue_x0020_Type"].ToString().Trim()) == "Open"
                                             group p by DateTime.Parse(p["Create_x0020_Date"].ToString()).Month                                                into g
                                             select new { month = g.Key, count = g.Count() });
Access items Linq with for loop .

 foreach (var listItem in ItemsDetails )
                            {
                                int Month = (listItem.month);
                             

                            }

Comments

Popular posts from this blog