last record

  • Thread starter Thread starter Darren Spooner
  • Start date Start date
D

Darren Spooner

how do i get the last record in a dataset
in ado i would use rs.movelast, now how do i do that in ado.net?
 
you can reference it like this (I'm assuming it's a datatable you are trying
to refer to)

int i = DataSetName.Tables[TableIndex].Rows.Count -1;
Now you know the index of the last record...so you can essentially use the
same logic to hit the row:

DataSetName.Tables[TableIndex].Rows;

If you are trying to do it visually, use the same logic but set the
BindingContext's position to i instead of the Table's Rows to i.

HTH,

Bill
 
Back
Top