I currently have a getresults() function which returns a dataset . I bind that result to a datagrid . all of this works fine ( see sample below) .
DataSet dataset = getResults(); //retruns a data set
MyDataGrid.DataSource = dataset.Tables.DefaultView;
I want to filter the results that is returned from getresults function before I bind it to the DataGrid, and was thinking to use linq ,
var result = getResults();
var filteredResults = from x in result.Tables.AsEnumerable()
orderby x.Field<DateTime>("lastUpdated") ascending
this query works and I get the filteredResults as desired, but now how do I bind this to the DataGrid. Also, how do I take the first 20 , from the result?