Hello i have a datatable

|row|col2|col3|col4|col5|
| 1 | val| val| val| val|
| 2 | val| val| val| val|
| 3 | val| val| val| val|
| 4 | val| val| val| val|
| 5 | val| val| val| val|
| 6 | val| val| val| val|
| 7 | val| val| val| val|
| 8 | val| val| val| val|
| 9 | val| val| val| val|
| 10| val| val| val| val|
| 11| val| val| val| val|
| 12| val| val| val| val|
| 13| val| val| val| val|

how can i select the data in datatable
when user click nextpagebutton : gridview.Datasource = datatable where row between 1 and 5
when user click nextpagebutton again : gridview.Datasource = datatable where row between 6 and 10
and . . . so that i can apply paging

Yes, the DataTable.Select method supports boolean operators in the same way that you would use them in a "real" SQL statement:

DataRow[] results = table.Select("A = 'foo' AND B = 'bar' AND C = 'baz'");

Edited 4 Years Ago by pritaeas: Removed self promotion link

Thanks for taking the time to discuss this, I feel strongly about it and love learning more on this topic. If possible, as you gain expertise, would you mind updating your blog with more information? It is extremely helpful for me.

Edited 4 Years Ago by happygeek: fake sig deleted

GridView supports paging directly, give the page property as 5, and u need to bind the gridview with the datatable in the PageIndexChanging Event.
Datatable.Select can be used only when you need to filter out some data from the datatable...

This question has already been answered. Start a new discussion instead.