You can use
DataTable.Select Method (String) (System.Data)[
^]
[EDIT] I re-read you question and spotted the
Quote:
i want to execute some conditon for sum and group by in datatable
The Select on the datatable is only a filter so will not help you with
group by
or
sum
. Personally, I would just go back to the database for that information. Otherwise you will need to step through the results e.g.
var sum = 0;
foreach (DataRow dr in dt.Rows)
{
sum += int.Parse(dr.ItemArray[3].ToString());
}
You can convert some of this to Linq e.g. the above is the same as
var sum = dt.Rows.Cast<DataRow>().Sum(dr => int.Parse(dr.ItemArray[3].ToString()));