public ActionResult ViewMyContacts(string srcMobile) { DataTable dtLocation = new DataTable(); UserDetails objUserDetails = new UserDetails(); dtLocation = objUserDetails.GetContactBySourceContact(srcMobile); IList <Contacts> items = dtLocation.AsEnumerable().Select(row => new Contacts { ContactName = row.Field <string>("ContactName"), ContactNumber = row.Field <string>("ContactNumber"), SoruceName = row.Field <string>("Name"), Location1 = row.Field <string>("LocationId1"), Location2 = row.Field <string>("LocationId2"), Location3 = row.Field <string>("LocationId3") }).ToList(); return(View(items)); }