我正在尝试将值从 a 加载List<dataset>
到List<Person>
我已经编写了以下代码,但不确定下一步该做什么
public List<Person> AddressFinderBLL_GetAddressbyName(String pfname,)
{
List<Person> Per= new List<Person>();
List<DataSet> lstPer = new List<DataSet>();
lstPer = Adal.AddressFinderDAL_GenerateDatabyName(
pfname, pfnameval, plname, plnameval);
//here List<Dataset> lstPer loaded with values from back end foreach(DataRow item in lstPer[0].Tables[0].Rows)
{
// here i need to assign the values to List<Person> from List<Dataset>[0].tables[0].rows;
}
Person 类具有以下属性 class class Person {
public String _firstname,_middlename;
public Person()
{
}
public String Firstname
{
get
{
return _firstname;
}
set
{
_firstname = value;
}
}
public String Middlename
{
get
{
return _middlename;
}
set
{
_middlename = value;
}
}
} 请告诉我