If you are using the DefaultView and you don't have a filter condition, then
Ralph's implementation will work. Assuming that you only want to work with
a DataView, you can use the same logic, just change the reference from
DataSet.Table to DataView. In general, I prefer an enumerator like this,
but it's 6 of one half dozen of the other but you can use a for loop for a
better implementation for this specific issue...
for(int i = 25; i<=50; i++){
Debug.WriteLine (row[i];
}
If you have a column who's number corresponds to row value, then you can use
something like
DataRow[] dRows = ds.Tables[0].Select("ID > 25 and ID < 51) //Since you are
using Defaultview, this should work as well even if you don't use the view
per se.
--This is the enumerated example, just for reference b/c it's the better
solution here.
DataView v = new DataView(ds.Tab les[0].DefaultView);
DataRowView dro;
IEnumerator myEnum = v.GetEnumerator ();
int x = 0;
while(myEnum.Mo veNext()){
//Check for the row position
if(x >25 and x < 51){
Debug.WriteLine (
}
i++
}
"Hardy Wang" <ha********@mar ketrend.com> wrote in message
news:%2******** **********@TK2M SFTNGP10.phx.gb l...
Hi all:
I have a DataSet populated with values. How can I return
ds.Tables[0].DefaultView's records from a starting number to a ending
number?
For example, I have 100 records in the DefaultView, but I just need
records from 25th to 50th.
Thanks for any suggestion!
--
WWW: http://hardywang.1accesshost.com
ICQ: 3359839
yours Hardy