public List<New> getNewsType() { NewsDataContext objNews = new NewsDataContext(); // new instance of class var allNews= objNews.News.GroupBy(x => x.Department).Select(x => x.SingleOrDefault()); return allNews.ToList(); private void bindNews() { linqClass objLinq = new linqClass(); ListView1.DataSource = objLinq.getNewsType(); ListView1.DataBind(); ddl_news.DataSource = objLinq.getNews(); ddl_news.DataTextField = "Department"; ddl_news.DataValueField = "Department"; ddl_news.DataBind(); }
ICollection<ServiceContract> serviceContract = mapper.MapDALServiceContracts2BAL(objDalServiceContract.getAllServiceContract()); if (id > 0) { var sc = serviceContract.GroupBy(m => m.EndDate).Select(g => g.First()); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)