2016-05-29 2 views

Antwort

1

Meine beste Vermutung:

var datarows = myDataSet.Tables["table1"].AsEnumerable() 
     .Where(x=> x.Field<int>("col1") == 1 && x.Field<string>("col2") == "specificvalue") 
     .Select(x=>new 
      { 
      col3 = x.Field<int>("col3"), 
      col4 = x.Field<int>("col4") 
      }) 
     .ToList(); 
1

etwas andere Syntax:

var result = from row in set.Tables["table1"].AsEnumerable() 
       where row.Field<int>("column1") == 1 && 
        row.Field<string>("column2") == "specificValue" 
       select new { Column3 = row.Field<string>("Column3"), 
          Column4 = row.Field<string>("Column4") }; 
Verwandte Themen