Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Collections

Collections

Scheduled Pinned Locked Moved Visual Basic
helpquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mikasa
    wrote on last edited by
    #1

    Ok, I have searched and searched everywhere and can find nothing. I am trying to implement my own Collection Classes. However, no matter what I try, I cannot get the "For..Each..Next" syntax to work. Evertime it tries to access it (For Each User in UsersCollection), it gives me an 'System.InvalidCastException' error. Aside from creating Strongly Typed Collection Classes, does anyone know how this can be implemented? :confused:

    N 1 Reply Last reply
    0
    • M mikasa

      Ok, I have searched and searched everywhere and can find nothing. I am trying to implement my own Collection Classes. However, no matter what I try, I cannot get the "For..Each..Next" syntax to work. Evertime it tries to access it (For Each User in UsersCollection), it gives me an 'System.InvalidCastException' error. Aside from creating Strongly Typed Collection Classes, does anyone know how this can be implemented? :confused:

      N Offline
      N Offline
      Nick Parker
      wrote on last edited by
      #2

      Tim McCurdy wrote: it tries to access it (For Each User in UsersCollection), it gives me an 'System.InvalidCastException' error. Does your class implement IEnumerable Interface? What is wrong with using an ArrayList object? Nick Parker
      The greatest lesson in life is to know that even fools are right sometimes. - Winston Churchill


      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups