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'");

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.

thanks for the help man.

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...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.