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

07-Jan-08 08:42:19
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?
reply
 
 

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

07-Jan-08 08:46:33
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.

--
Lasse Vågsæther Karlsen
mailto:lasse@vkarlsen.no
http://presentationmode.blogspot.com/
reply
 

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

07-Jan-08 09:03:05
It's the record with the highest primary key value... each record also
contain a datatime value specifying when the record was created...
reply
 

newbie: Getting the latest record in a DataTable in DataSet ??? - Ignacio Machin \( .NET/ C# MVP \)

07-Jan-08 09:09:07
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.
reply
 
Net Remoting and Performace
promotion
Silverlight    WPF    WCF    WWF    LINQ   
JavaScript    AJAX    ASP.NET    XAML   
C#    VB.NET    VB 6.0    GDI+    IIS    XML   
.NET Generics    Anonymous Methods    Delegate   
Visual Studio .NET    Expression Blend    Virus   
Windows Vista    Windows XP    Windows Update   
Windows 2003 Server    Windows 2008 Server   
SQL Server    Microsoft Excel    Microsoft Word   
SharePoint    BizTalk    Virtual Earth   
.NET Compact Framework    Web Service   

"Everything" RSS / ATOM Feed Parser
How to send and receive messages through message queuing in .Net
How to Read text file as database
SQL Server 2005 Paging Performance Tip
Display code of web page.
Fully Scalable Excel File Importer class for .net using Microsoft Jet driver
Generic Chart Color Manager class that can be used for any charts
Helper class to style the infragistics wingrid
Using Reflection to detemine as Assembly Info in and out.
Helper class to play with Window (Owners and position)
Resolving displayname from the culture using the XmlLanguage and LanguageSpecificStringDictionary class