我需要做 select 和 foreach 但它不起作用。我怎样才能做到这一点?
Ds ds = new Ds(); //DataSet
Ds.HousesRow houseRow= ds.House.NewHousesRow();
houseRow.color= "red";
houseRow.date= new DateTime();
houseRow.description= "ZZZ";
ds.Houses.AddHouseRow(houseRow);
var lHouses= ds.Houses.Select(i => new { i.color, i.description}).OrderBy(i => i).Distinct();
foreach (Ds.HousesRow item in lHouses)
{
System.Diagnostics.Debug.Print("Color: " + item.color + "Description: " + item.description);
}
Tks