I'm working in WinForms application. My requirement is loading the data from sql on demand(i.e load 100 records for a page, when moves to that page). So i tried below SqlCommand but it throws the exception at place of "ROW_NUMBER()" syntax in the below command,
SELECT *
FROM (SELECT *
, ROW_NUMBER() (ORDER BY [ID]) AS RowNum
FROM [tblVGTest]
WHERE [ID]) AS Temp
WHERE RowNum BETWEEN 0 AND 100
Please let me know, is there any mistakes in command or provide any suggestion for my scenario.
Thanks