110,825
社区成员
![](https://csdnimg.cn/release/cmsfe/public/img/topic.427195d5.png)
![](https://csdnimg.cn/release/cmsfe/public/img/me.40a70ab0.png)
![](https://csdnimg.cn/release/cmsfe/public/img/task.87b52881.png)
![](https://csdnimg.cn/release/cmsfe/public/img/share-circle.3e0b7822.png)
public class Person
{
public string Name {get;set;}
public int Age {get;set;}
}
public List<Person> getPersonEntities(DataSet personDS)
{
List<Person> list = new List<Person>();
if(personDS!=null&&personDS.Tables[0].Rows.Count>0)
{
foreach(DataRowView drv in personDS.Tables[0].DefaultView)
{
Person p = new Person();
p.Name = drv["Name"].ToString();
p.Age = int.Parse(drv["Age"].ToString());
list.Add(p);
}
}
return list;
}