Monday, October 10, 2011

How to add arraylist inside of the arraylist in asp.net

ArrayList xxx = new ArrayList();


//////////////Adding inside of arraylist////////////////

for (int g = 1; g <= dt.Rows.Count; g++)
{
xxx.Add(new ArrayList());

}


/////////////////reading the arraylist inside of arraylist/////////////////

for (int g = 0; g < dt.Rows.Count; g++)

{
(xxx[g] as ArrayList).Add(dt2.Rows[j][1+g].ToString());

}

No comments:

Post a Comment