using(DBDataContext db = new DBDataContext()){
var matches = from t in db.tProjectOutlays
where
(!string.IsNullOrEmpty(key1.Text) ? t.Name.Contains(key1.Text.Trim()) : true)
group t by t.CostingID into p
select new
{
ID = t.id,
Name = t.Name,
};
gv.DataSource = matches.OrderByDescending(t => t.ID);
gv.DataBind();
}
|