Yea but there was nothing in there about sortingThis is where I am having my problems...I can sort the text but not the integer...I have scoured the internet and cant find anything...I am unfamilar with TypeCast, DirectCast syntax in this instant...VB example you postedDim results = From g In graphicCollection Group g By GroupKey = CStr(g.Attributes("Officer")) Into r = Group Select New With {Key .Officer = GroupKey, Key .Incidents = r.Sum(Function(i) Convert.ToInt32(i.Attributes("Incident")))}
For Each item In results
MessageBox.Show(String.Format("Officer {0} has {1}", item.Officer, item.Incidents))
Next item
This is my appempt at sorting...I assume that I should be grabbing the Actual Field Name (incidentNum) instead of the created attribute (IncidentNums with an s)Dim results2 = From g In featureSet
Order By CStr(g.Attributes("IncidentNum")) Ascending
Group g By GroupKey = CStr(g.Attributes("Officer")) Into r = Group
Select New With {Key .Officer = GroupKey, Key .IncidentNums = r.Sum(Function(i) Convert.ToInt32(i.Attributes("IncidentNum")))}
Variations triedOrder By CType(g.Attributes("IncidentNum"), Integer) Descending
Order By DirectCast(g.Attributes("IncidentNum"), Integer) Descending
Order By TryCast(g.Attributes("IncidentNum"), String) Descending