• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 196
  • Last Modified:

Accessing property of an object within a collection

I've got a collection of objects and I want to access the value of a property from the object.
I've attached the immediate window below
events[0]
{Basic First Aid for Appointed Person}
    _CourseID: "CT-BF6"
    _Distance: 0.0
    _EndDate: {02/11/2007 08:00:00}
    _Ett_ID: "8374-ct"
    _EventID: "8374-ct"
    _FreePlaces: 1
    _Price: 76.0
    _StartDate: {02/11/2007 08:00:00}
    _VenueID: "T12580"
    Course: {Basic First Aid for Appointed Person}
    CourseID: "CT-BF6"
    Distance: 0.0
    EndDate: {02/11/2007 08:00:00}
    Ett_ID: "8374-ct"
    EventID: "8374-ct"
    FreePlaces: 1
    Price: 76.0
    ShowURL: "./?page=CourseDetails&CourseID=CT-BF6"
    StartDate: {02/11/2007 08:00:00}
    Venue: {Bradford - Carlisle Business Centre}
    VenueID: "T12580"

I want to get the VenueID value

Any help would be appreciated

Thanks Robert
0
Browski
Asked:
Browski
1 Solution
 
MikkkCommented:
Try:
events[0][VenueID]
0
 
BrowskiAuthor Commented:
Mikkk, this doesn't work, you get the message "The name 'VenueID' does not exist in the current context"

0
 
JimBrandleyCommented:
Can you post the code?

Jim
0
Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

 
BrowskiAuthor Commented:
I've resolved the issue now, the solution is

string venueID = ((w4a._code.CourseEvent)events[0]).VenueID;
lblLocation.Text = FAT.cls.Venue.Get(venueID).Facility;  

Thanks for your time
Robert
0
 
MikkkCommented:
Congratulations. I add it to my KnowledgeBase... :)
0
 
BrowskiAuthor Commented:
Issue was resolved by myself in the end
0
 
Computer101Commented:
PAQed with points refunded (125)

Computer101
EE Admin
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now