is it possible to order by dynamically created column like this (i want sort by AreaPriority, but with this query i get error invalid column name: AreaPriority, when i run this query in SQL Server Managment Studio everything works fine but in petapoco it runs error). Here is this select query:
SELECT strGet.StrengthId as AreaId, strGet.[Description] as AreaName,
(SELECT SUM(ias.Score) FROM ImprovementAreaScore ias WHERE ias.StrengthId=strGet.StrengthId) as AreaPriority
FROM
{0}.Strength strGet
WHERE
strGet.[Description] like '%' + @0 and strGet.SelfAssessmentId=@1 and strGet.IsStrength=0 and strGet.ToImprovementProject=1 ORDER BY AreaPriority", ...