471,045 Members | 1,299 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,045 software developers and data experts.

"ArrayList does not contain a definition for Item" - Tell me I'm being stupid

error CS0117: 'System.Collections.ArrayList' does not contain a definition
for 'Item'

Only one answer in Google Groups, and I'm positive I'm using it

Posts is my ArrayList.

I put in some posts:

for (i = 0; i < 15; i++)
myPost = new Post();
myPost.Key = i;
myPost.Level = i;
myPost.Subject = "The Subject " + i.ToString();
myPost.Author = "Test " + i.ToString();

Try and get them back out

for (int i = 0; i < Posts.Count; i++)
Post aPost = Posts.Item[i];

To get the error at the top. Foreach works, but I need a count too, so this
loop seems the best way.

I'm sure I'm doing something really stupid, but I really just can't figure
out what! :o(

Daisy The Cow
Now playing: DJ Sammy - Sunlight [Bossa Nova Mix]
Nov 13 '05 #1
1 5810
"Daisy" <da***@nospam.oops> wrote in message
error CS0117: 'System.Collections.ArrayList' does not contain a definition
for 'Item'

Yes, I was being stupid. I don't need Item!! Doh !

Daisy The Cow
Now playing: Clock - Oh What A Night
Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

15 posts views Thread by lkrubner | last post: by
9 posts views Thread by Lamont Sanford | last post: by
11 posts views Thread by L. Chen | last post: by
10 posts views Thread by Kobu | last post: by
51 posts views Thread by Tony Sinclair | last post: by
5 posts views Thread by mkaushik | last post: by
1 post views Thread by Kyle Morris | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.