public class MyEntity { public string Name {get; set;} public string Type {get; set;} public Load(object [] array) { this.Name = array[0].ToString(); this.Type = array[1].ToString(); } }
List<MyEntity> list = new List<MyEntity>();//foreach(DataRow dr in table.Rows)//table is your data table{ MyEntity obj = new MyEntity(); obj.Load(dr.ItemArray); list.Add(obj);}
Thank you, Govind
Login to post response