Populating List<T> , with a function
- List<ObjectFacotry> listempdb = of1.cEmp();
List<string> eList = new List<string>();
- Using foreach loop
foreach (var v1 in listempdb)
{ eList.Add(v1.ename + " " + v1.job + " \t" + v1.deptno); }
Please also review this example : LINQ_IEnumerable_AsEnumerable1.cs
- List<ObjectFacotry> listempdb = of1.cEmp();
ArrayList ar1 = new ArrayList();
- foreach (var v1 in listempdb)
{ ar1.Add(v1.ename + " " + v1.job + " \t" + v1.deptno);}
read(ar1, "\n");
|