public ActionResult Search(string txtCurProNo) { string strCurProNo = txtCurProNo.Trim(); UrbanConEntities entity = new UrbanConEntities(); var projectNos = (from p in entity.PaperArchives where (p.dateArchive.Value.Year) == Convert.ToInt32(strCurProNo) orderby p.projectNo descending select p); return(View(projectNos)); }