Collection of Objects
-
Hey All, How to collect the Objects? Like an array, how do we collect the objects?
-
Hey All, How to collect the Objects? Like an array, how do we collect the objects?
Do you mean an ArrayList ? Or are you using C# 2.0, then List<object> will do. Replace object with whatever class you want to collect. This is the sort of question that's bound to be covered by a beginners book, I recommend working through a book if you're serious about learning C#.
Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
-
Hey All, How to collect the Objects? Like an array, how do we collect the objects?
You can use ArrayList.............. Just declare like ArrayList objArrayList = new ArrayList(); Them you can add the objects objArrayList.Add(obj);
My small attempt...
-
You can use ArrayList.............. Just declare like ArrayList objArrayList = new ArrayList(); Them you can add the objects objArrayList.Add(obj);
My small attempt...
Hey All, Thank you very much for your kind help. so my question is, hwo could i store the objects of a table(which contains 2 columns and 170 rows) in an arrayList? -- modified at 12:19 Wednesday 18th April, 2007
-
Hey All, Thank you very much for your kind help. so my question is, hwo could i store the objects of a table(which contains 2 columns and 170 rows) in an arrayList? -- modified at 12:19 Wednesday 18th April, 2007
You mean you are having objects on each cell... try the foreach method to retrieve all from that. then use arraylist foreach(Datarow row from table.rows { objarrayList.Add(row["item"]; }
My small attempt...