Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6531679
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T09:54:28+00:00 2026-05-25T09:54:28+00:00

i m getting a collection of data in list’s object. And from this list

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T09:54:29+00:00Added an answer on May 25, 2026 at 9:54 am

    Well, you specify max in the title, and last in the question, so here’s both:

    Max:

    Photo_Image = hdd_AlbID.Value.ToString() & "_" & _
        objinfo.Max(Function(o) o.Photo_Id) _
               .Photo_Id.ToString()
    

    Last:

    Photo_Image = hdd_AlbID.Value.ToString() & "_" & _
        objinfo.Last().Photo_Id.ToString()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to fetch first element from the collection like this List<Entity> data =
I want to use LINQ to pass data from one custom collection to another.
If my string is 1,60299 getting collection of UserCodes .... then if I want
I am getting this exception: Collection was modified; enumeration operation may not execute. Directly
Getting this error when try to add an item to my repositories/context: Collection has
I'm stuck in getting the product url in a product collection. I have this
I'm getting the error Illegal access to loading collection when I'm trying to get
I'm trying to parse data from Archive.org's search functionality. The data looks like this:
I need to return a list of objects from a restful webservice. each object
Im getting a connection refused when I try to send some data to my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.