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

  • Home
  • SEARCH
  • 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 8428495
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T05:04:25+00:00 2026-06-10T05:04:25+00:00

I have an arraylist, that contains model class objects. Here is how I create

  • 0

I have an arraylist, that contains model class objects. Here is how I create the array list.

Dim arr As New ArrayList
Dim citizenHelper As New CitizensHelper
While dr.Read
    Dim appointment As New Appointment
    appointment.AppointmentId = dr("appointment_id")
    appointment.DoctorNin = dr("doctor_nin")
    appointment.DoctorName = citizenHelper.getNameByNin(dr("doctor_nin"))
    appointment.PatientNin = dr("patient_nin")
    appointment.PatientName = citizenHelper.getNameByNin(dr("patient_nin"))
    appointment.BookingDate = dr("booking_date")
    If dr("cancelled") Is "1" Then
        appointment.Cancelled = True
    End If
    If dr("active") Is "1" Then
        appointment.Active = True
    End If
    arr.Add(appointment) 'I add to the array like this
End While
ViewData("row") = arr

I want to use this arraylist to generate a table of records on the view page. I tried using a for loop but I cannot access the model values like that. So please tell me, how i can solve this?

I tried doing something like this

<% For Each ap As ArrayList In ViewData("row")%>
    <tr>
        <td>
            ...... <!-- Now I want to show those value from a table here -->
        </td>
    </tr>
<% Next ap%>
  • 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-06-10T05:04:26+00:00Added an answer on June 10, 2026 at 5:04 am

    You should use

    <% For Each ap As Appointment In ViewData("rows") As ArrayList %>
    <tr>
        <td>
            ...... <!-- Now I want to show those value from a table here -->
        </td>
    </tr>
    <% Next ap%>
    

    The ViewData(“rows”) contains the ArrayList so we need to iterate this collection, and the ArrayList contains the data of Appointment type.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a class that contains a list of objects. What's the best way
I have an array list that contains Quote objects. I want to be able
I have a two-dimension ArrayList that contains double values: ArrayList<ArrayList<Double>> data = new ArrayList<ArrayList<Double>>();
I have a class that contains two arraylists which I'm trying to store objects
I have an object that contains a list of other objects. Say it's as
I have an array-list that contains some UserID. I need a query like this:
For simplicity, say I have an ArrayList that contains objects of type A, B
In the life-cycle of my application, I have to re-create an ArrayList that contains
I have a class Line that contains an internal ArrayList<Double> . In my program,
I have an ArrayList that I want to use to hold RaceCar objects that

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.