0

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

4
Contributors
4
Replies
6
Views
4 Years
Discussion Span
Last Post by arunkumars
Featured Replies
  • 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'"); Read More

1

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 by pritaeas: Removed self promotion link

0

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 by happygeek: fake sig deleted

0

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.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.