I have 10,000 items in a table that display 20 items per page on the client side (items can be further filtered)
I need to find an element among all the elements. Then I need to get the page number where the item is located and go to this page on the client and select it
My previous question is Get the item index (rownum) .
But I did not receive an answer to this.
Perhaps there is another way to find the page number where the element is located without getting all the table data?
I am using Linq for Nhibernate, Database - Oracle.
Edit: Thanks for the answers, but it's not that simple.
Example:
In the db table I have
ID NAME
1 Item1
2
3
4
5
20
31
..... ....
5000
On the client side, I have filtered data
query = query.Where(...).Where(...).Where(...).OrderBy(...)
and got the result
ID ROW_NUM_IN_QUERY
4 1
300 2
2 3
31 4
..... ....
402 50
800 51
ID ,
rownum SQL. Linq NHibernate . IndexOf RowNumber .
:
var indexed = myDataSource.Select( (x,n) => new { Value = x, RowNumber = n } );
Not suported exception during execute query