I have a linq query and inside of it is the month name. I want the results sorted by the month (Jan, Feb, Mar, ...).
Currently I have the below but it\'s giving me and e
The best way and easiest way is create a stored procedure
Create procedure sortevents
as
SELECT *
FROM [SAGMJ].[dbo].[Events]
ORDER BY CASE
WHEN MONTH([StartAt]) = MONTH(GETDATE())
AND YEAR([StartAt]) = YEAR(GETDATE()) THEN 0
ELSE 1
END, [StartAt];
//Next call your sp
var v = (dc.sortevents()).ToList();