Collections
-
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:
-
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:
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 anArrayList
object? Nick Parker
The greatest lesson in life is to know that even fools are right sometimes. - Winston Churchill