Click here to Skip to main content
15,894,017 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
Hi...

Ive used http://www.c-sharpcorner.com/uploadfile/dhananjaycoder/crud-operation-in-Asp-Net-mvc-framework/ to create a database driven website for a rental company using the CRUD outlook...but now im looking to add a search feature and cant find any online....any help guys?

iv tried something like

 public ActionResult Search(int id)
        {
            return View();
        }

        [HttpPost]
        public ActionResult Search(Rental rentals)
        {
            try
            {
               
                _entities.//find record(rentals);
                _entities.SaveChanges();

                return RedirectToAction("Index");
            }
            catch
            {
                return View();
            }
        }
Thanks
Posted

1 solution

var dbdata = (from v in contex.VotnetMasters
where v.VotnetID == csv.VotnetID
select new { v.MemberID,v.OnlineUsername }).FirstOrDefault();
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900