yes, I suppose I am - but you could do the same thing in SQL... ... ORDER BY Count(*) DESC
I've tried assigning the Count() result to a property of a object and doing a projection, and then ordering on that property instead, but I still get the same problem... James 2009/6/22 Plácido Bisneto <[email protected]> > are you trying to do an orderby without a property name?! > > Plácido Bisneto > .NET Developer > Blog: http://cidico.wordpress.com > OpenControls: http://opencontrols.codeplex.com > > > 2009/6/21 James Crowley <[email protected]> > > hey guys, >> is there any way to get orderby working in conjunction with group by in >> the Linq to SQL provider at the moment? >> >> for instance: >> >> from t in _queryService.ContentAttributeView >> group t by t.Name >> into g >> orderby g.Count() descending >> select g.Key; >> >> fails with >> >> [NullReferenceException: Object reference not set to an instance of an >> object.] >> >> NHibernate.Loader.Criteria.CriteriaQueryTranslator.GetEntityName(ICriteria >> subcriteria, String propertyName) +57 >> >> >> but it works fine without the orderby. >> >> cheers! >> >> James >> >> >> > > > > -- James Crowley Managing Director Developer Fusion - Connecting developers worldwide Developer Fusion Ltd | 58 Sandringham Close | Enfield, EN1 3JH mob: 07986 624128 web: http://www.developerfusion.com/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "nhusers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/nhusers?hl=en -~----------~----~----~----~------~----~------~--~---
