Dataset
-
Hi I have some records say 1000 Nos fetched from SQL and stored in a Dataset. Now I need to fetch and store top 1-50 records in another dataset and top 51-100 records in another dtaset and so on. Could any one help me how to transfer records from one Dataset to another dataset? Regards San
-
Hi I have some records say 1000 Nos fetched from SQL and stored in a Dataset. Now I need to fetch and store top 1-50 records in another dataset and top 51-100 records in another dtaset and so on. Could any one help me how to transfer records from one Dataset to another dataset? Regards San
Surely what you want is a stored procedure that pages your data ? The way to do this is to do two selects, that are nested, use the TOP statement in both, and have one ordered ASC and the other DESC. So the first grabs from the first record through to the last one you want, the other inverts the order and selects from the last one you want to the first one you want. Christian Graus - Microsoft MVP - C++
-
Surely what you want is a stored procedure that pages your data ? The way to do this is to do two selects, that are nested, use the TOP statement in both, and have one ordered ASC and the other DESC. So the first grabs from the first record through to the last one you want, the other inverts the order and selects from the last one you want to the first one you want. Christian Graus - Microsoft MVP - C++
Sorry My idea is to manipulate the data locally, . My ultimate aim is to do paging in dataGrid since winform GataGrid is not supporting the Paging.
-
Sorry My idea is to manipulate the data locally, . My ultimate aim is to do paging in dataGrid since winform GataGrid is not supporting the Paging.
Really ? Only the web DataGrid does paging ? I didn't realise that. Well, the easiest thing would still be a stored proc that takes a page number and size, but if you want to limit your database access, then I guess you'd store the full table locally, and build a datasource from it that you bind to the grid, selecting only the current page rows. Christian Graus - Microsoft MVP - C++
-
Sorry My idea is to manipulate the data locally, . My ultimate aim is to do paging in dataGrid since winform GataGrid is not supporting the Paging.
I would add a
DataColumn
withAutoIncrement
set totrue
to the table, and then use aDataView
and itsRowFilter
property to just return the records with that column from 1 to 50. -- LuisR
Luis Alonso Ramos Intelectix - Chihuahua, Mexico Not much here: My CP Blog!