alist[0] and alist[1]
//OUTPUT
DBID,VERSION,DB_NAME,INSTANCE_NAME,HOST_NAME
alist[0] == 806497854,10.2.0.5.0,ALPHA,ALPHA,ALPHA-SERVE alist[1] == 3895980978,10.2.0.1.0,BETA,BETA,BETA-SERVER
// END OF OUTPUT
as you can see from the output, within the alist[0] I have 5 ItemArray objects
I'm trying to get a checkbox populated with list of items from arraylist. I'm getting "Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index" error. here is the code
Expand|Select|Wrap|Line Numbers
- alist = new ArrayList();
- alist = (ArrayList)ProgramLogic.runsqlAL(sqltext, Form1.OraConn);
- // alist has 2 items 0 and 1
- // alist itemArray has 5 objects in each itemlist
- for ( int i = 0; i <= alist.Count;i++)
- {
- for (int j = 0; j <= (((DataRow)alist[i]).ItemArray.Count()); j++)
- {
- MessageBox.Show("i is " + i.ToString() + "and j is " + j.ToString());
- //avail_dbid_CB.Items.Add(((DataRow)alist[i]).ItemArray[j].ToString());
- }
- }