By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,662 Members | 1,429 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,662 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
correctly...!

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();
bottomControl.Posts.Add(myPost);
}

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(

Thanks,
--
Daisy The Cow
Now playing: DJ Sammy - Sunlight [Bossa Nova Mix]
Nov 13 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
"Daisy" <da***@nospam.oops> wrote in message
news:be**********@linux01.dannytuppeny.com...
error CS0117: 'System.Collections.ArrayList' does not contain a definition
for 'Item'


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

:O)
--
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.