newbie: Getting the latest record in a DataTable in DataSet ???

J

Jeff

Hey

..NET 2.0
Sql Server 2005

AFIAK when my .NET app starts it fills every DataTable objects in the
DataSet with data

I wonder how to retrieve the latest record from a DataTable in a DataSet?

any suggestions?
 
L

Lasse Vågsæther Karlsen

Jeff said:
Hey

.NET 2.0
Sql Server 2005

AFIAK when my .NET app starts it fills every DataTable objects in the
DataSet with data

I wonder how to retrieve the latest record from a DataTable in a DataSet?

any suggestions?

Define latest record.

Is it the one with the highest primary key value? The highest time stamp
value?

Perhaps it's just a matter of ordering your data accordingly.
 
J

Jeff

It's the record with the highest primary key value... each record also
contain a datatime value specifying when the record was created...
 
I

Ignacio Machin \( .NET/ C# MVP \)

Hi,


Just create a DataView with the correct sorting and it would be either the
first or the last record in the DataView

--
Ignacio Machin
http://www.laceupsolutions.com
Mobile & warehouse Solutions.
Jeff said:
It's the record with the highest primary key value... each record also
contain a datatime value specifying when the record was created...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top