Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: MVC
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 21-Oct-12 14:15pm

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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

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



Advertise | Privacy | Mobile
Web04 | 2.8.1411022.1 | Last Updated 21 Feb 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100