List<uint> myList = (from row in aDataSet.Tables[0].AsEnumerable()
select row.Field<uint>("AColumnName")).ToList();
List<uint> myList = aDataSet.Tables[0].AsEnumerable().Select(dataRow => dataRow.Field<uint>("AColumnName")).ToList();
IEnumerable<uint> myList = aDataSet.Tables[0].AsEnumerable().Select(dataRow => dataRow.Field<uint>("AColumnName"));
Create a Dictionary from two fields in the DataSet:
Dictionary<uint, uint> myDictionary = aDataSet.Tables[0].AsEnumerable()
.ToDictionary(k => k.Field<uint>("KeyColumn"), v => v.Field<uint>("ValueColumn"));
No comments:
Post a Comment