Hi,
I have an generic array list
I have created a class employee details and declared variables such as empid,empname, empdepartement, empsalary etc.
I have inserted the values as a object
i.e. i have declared
Now I have added the values in the main program as
i have added details in the below manner
1. Enter total no of depts.
2. for i = 1 to depts
(Added, department name, employee name, etc...)
Now I want the output as below
Department Name=Chemical
list of employess
Department Name=Computer
List of employess
I get the department name in each and every count,
But I want to be displayed Department Wise.
How do I do that?
Suggestions pls
Regards
cmrhema
I have an generic array list
I have created a class employee details and declared variables such as empid,empname, empdepartement, empsalary etc.
I have inserted the values as a object
i.e. i have declared
Code:
public class GenericClass<T> { List<Emp_Details> myEmpDetails= new List<Emp_Details>(); public void adddetails(Emp_Details id) { myEmpDetails.Add(id); } }
Code:
GenericClass<Emp_Details> gc1 = new GenericClass<Emp_Details>(); Emp_Details id; gc1.adddetails(id);
1. Enter total no of depts.
2. for i = 1 to depts
(Added, department name, employee name, etc...)
Now I want the output as below
Department Name=Chemical
list of employess
Department Name=Computer
List of employess
Code:
If i use for (i=0;i<myempdetails.count;i++) {//list all employees}
But I want to be displayed Department Wise.
How do I do that?
Suggestions pls
Regards
cmrhema
Comment