G
Guest
Hi there
I have a requirement to filter off 5 records from a datatable in a dataset.
I have a SQL procedure that retrieves a large lump of data from a database -
I then do whatever I'm doing with that data. I have a seperate DataList on my
aspx page that should contain summary details of the latest 5 records
retrieved in the main data pull.
I don't want to re-connect to the SQL database - but am struggling to use
DataView when all I have to work on is a Date field - so the DataList should
show the 5 most recent records - from what I can tell, my filter statement
can only be relatively simple - not "Select TOP 5 Records from X where A='B'"
etc. etc - I don't think this is designed for the purpose, but please tell me
otherwise if I'm wrong.
This leaves me with Datagrid.Select which I have not used before - should I
be able to use a "proper" select Statement ("Select TOP5....") - if so, how
would I then copy this to a new datatable so I can bind my DataList to it ?
I suppose an alternative would be to limit the number of records my DataList
can display... but again, if there is a way to do this, I can't find out
how...
Any thoughs / help is much appreciated
Stuart
I have a requirement to filter off 5 records from a datatable in a dataset.
I have a SQL procedure that retrieves a large lump of data from a database -
I then do whatever I'm doing with that data. I have a seperate DataList on my
aspx page that should contain summary details of the latest 5 records
retrieved in the main data pull.
I don't want to re-connect to the SQL database - but am struggling to use
DataView when all I have to work on is a Date field - so the DataList should
show the 5 most recent records - from what I can tell, my filter statement
can only be relatively simple - not "Select TOP 5 Records from X where A='B'"
etc. etc - I don't think this is designed for the purpose, but please tell me
otherwise if I'm wrong.
This leaves me with Datagrid.Select which I have not used before - should I
be able to use a "proper" select Statement ("Select TOP5....") - if so, how
would I then copy this to a new datatable so I can bind my DataList to it ?
I suppose an alternative would be to limit the number of records my DataList
can display... but again, if there is a way to do this, I can't find out
how...
Any thoughs / help is much appreciated
Stuart