Click here to Skip to main content
15,888,521 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hi,
i have take one arraylist..and i store 3 values in that..
my question is how to read that 3 value and stored in 3 different variables in asp.net

pls reply me..
Posted

1 solution

try this
C#
System.Collections.ArrayList arraylist = new System.Collections.ArrayList();
            arraylist.Add("firstValue");
            arraylist.Add(2);
            arraylist.Add("3rdValues");

            //take specific value using index

            string value = arraylist[0] as string;  //you take values as you saved.
            var val2 = arraylist[1];

            //to display all
            foreach (var item in arraylist)
            {
                Console.WriteLine(item);
            }
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900