I am trying to sent a query string to the database, but got this error -->
A TOP can not be used in the same query or sub-query as a OFFSET.
When I debugged the query string , I observe that
"select * from TABLE"
is changed to "select * from TABLE Fetch Next 50 Rows Only"
(where number of columns =50(already set)).
Required Output
select top * x from [TABLE]
to
select * from [TABLE] Fetch Next x Rows Only
What I tried
I tried to use , find and replace the 'top * x' to integer x and *
string CommandText = "select * from TABLE";
CommandText =CommandText
+ orderby + " OFFSET " + (request.Page - 1) * request.PageSize
+ " ROWS FETCH NEXT " + request.PageSize + " ROWS ONLY";
Kindly help me to find the solution.