Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!
Structure AuthenticationRecord Dim UserID As String Dim UserPW As String Dim AuthLevel As String Dim TS As Date End Structure Dim AuthenticationDataCache As List(Of AuthenticationRecord) Private Sub Test() Dim AR As AuthenticationRecord AR.UserID = "TestUserName1" AR.UserPW = "TestPW1" AR.AuthLevel = "3" AR.TS = Now.AddMilliseconds(-1000) AuthenticationDataCache.Add(AR) AR.UserID = "TestUserName1" AR.UserPW = "TestPW1" AR.AuthLevel = "-1" AR.TS = Now() AuthenticationDataCache.Add(AR) 'Here is where I get stuck.... 'My need is to retrieve the newest Record in the collection (as defined by TS). In the above 'example, the record with AuthLevel = -1 is most recent (based on TS) 'I either need a LINQ Query to do this, or to sort the contents of the collection 'with the most recent TS record item towards the top, then I would iterate through the collection 'from the beginning to find the first occuring UserID I was looking for. End Sub
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.