TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Marto
NA
8
0
A bug in Arraylist ????
Jun 20 2008 9:46 AM
I have tried to make the following array dynamic but ran into a 'problem'. The datatable below has 4 items.
int[] refNos = new int[100];
for (int i = 0; i < newTable2.Rows.Count; i++)
{
refNos[i] = System.Convert.ToInt32(newTable2.Rows[i][1]);
}
When I display refNos[i] I get all items, however if I use an array list instead I get 3 items. The last item is not displayed ?
ArrayList refNos = new ArrayList();
for (int i = 0; i < newTable2.Rows.Count; i++)
{
refNos1.Add(System.Convert.ToInt32(newTable2.Rows[i][1]));
}
This does not display the last item. Why ?
I would really like to make this dynamic but I can't get through ?
Reply
Answers (
2
)
What's the best way to do this?
Using Multidimensional aarays