Hi Experts,
I need to create DataTable from my List<Employee> class. My DataTable should contain all the values of List<string> or Dictionery which is in List<Employee> class.I want the rows to be duplicated with all values of Dictionery or List<string> values.
I want all the other properties to be duplicated with respect to List<String>.. i.e Non System.Collections.Generic properties should be duplicated based on the lenght of the System.Collections.Generic properties.
For Ex:
Employee object has name, age,List<string>, Dictionery<string,string>
say,
name = "mike"
age = "30"
List<string> certificateGot = new List<String>
CertificateGot.Add("MSCE");
CertificateGot.Add("MCP");
Now add CertificateGot to List<Employee> object..
Dictionery<string,string> prevCompNameandPlace = new Dictionery<string, string>();
prevCompNameandPlace.Add("xyz", "London")
prevCompNameandPlace.Add("abc", "USA")
Now add prevCompNameandPlace to List<Employee> object..
In my datatable I need like this
Name Age CertificateGot NamePlace
Mike 30 MSCE --
Mike 30 MCP --
Mike 30 -- xyz,London
Mike 30 -- abc,USA
I want all the other properties to be duplicated with respect to List<String>.. i.e Non System.Collections.Generic properties should be duplicated based on the lenght of the System.Collections.Generic properties.
Any help would be appreciated.
Regards,
T.N.Nagasundar
Regards,
T.N.Nagasundar