【发布时间】:2015-10-01 10:41:32
【问题描述】:
具有值列表的表[1]。
if (ds.Tables[1].Rows.Count > 0)
{
// How to loop through datatable values without using for or foreach loop and then list values add to List?//
testRetrieveResponse.testList.Add();- how to add values to list
}
【问题讨论】:
-
foreach有什么问题? -
添加什么参数?
-
testList= new FacilityInfo(); testList.FacilityId = Convert.ToInt32(row["FACILITY_ID"]); testList.FacilityName = Convert.ToString(row["FACILITY"]); testRetrieveResponse.testList.Add(testList);
标签: c# asp.net ado.net generic-list