I have created a view in SQL Server which is working properly and sorting exactly as I require. Here is the view ...
CREATE VIEW [vwInventoryList]
AS
SELECT TOP 100 PERCENT x.[Cols_I_Need]
FROM dbo.vwInventoryListSummary x
GROUP BY x.[columns]
ORDER BY dbo.x.ID,dbo.x.[Description],[with_more_4_cols]
GO
The issue is when I execute the below sql from C# or even in SQL Server Management Studio, the result is not sorted as I have specified in my view and I don't understand why.
Select * from vwInventoryList
I would like the view to control the sorting of the data and my code (select statement) should simply select from the view without specifying the order by in the C# code.
Any ideas why this is happening ?