returning the value of the last record in a dataset

  • Thread starter Thread starter Winshent
  • Start date Start date
W

Winshent

I need help with this as i am spending far too much time on it. Moving
across from vba to .net hasnt been easy..

I need to return the value in a field of the last record in a sorted
dataset.

A brief example of anyone would be really helpful..

i would approach this by sorting the records and performing a count on
the records. Then returning the value in:

dataset.tables("MyTable").columns("MyCol")..

and also using (dataset.tables("MyTable").count) to get the last
record

help please!!
 
dim rows as DataRowCollection
rows = dataset.Tables("MyTable").Rows
value = rows(rows.Count - 1)("MyCol")

Ben Lucas
Lead Developer
Solien Technology, Inc.
www.solien.com
 
Back
Top