i m getting a collection of data in list’s object. And from this list i want to get the maximum id.`
Dim objinfo As List(Of AlbumInfo) = objPhotos.GetPhotos_Alb_ID(Me.ModuleId, hdd_AlbID.Value)
Dim Photo_Image As String = ""
Dim str As String = Photo_Image & fu_Photo.PostedFile.FileName.Substring(fu_Photo.PostedFile.FileName.LastIndexOf("."))
If objinfo.Count >= 1 Then
Photo_Image = Convert.ToString(hdd_AlbID.Value) + "_" + Convert.ToString(objinfo.Item("0").Photo_Id + 1)
Else
Photo_Image = Convert.ToString(hdd_AlbID.Value) + "_" + Convert.ToString("1")
End If
this returns the “0”th positions id from Convert.ToString(objinfo.Item("0").Photo_Id + 1)
but i want to get the last item’s id.
Well, you specify max in the title, and last in the question, so here’s both:
Max:
Last: