Click here to Skip to main content
15,902,198 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hello

I am trying to perform a search on my Admin page.. what I want the search to do is find data in all different tables that I have.. eg I have a student controller and employee controller. I want to perform a search using one textbox and one button but be able to search both employee table and student table.. at the moment I am able to create one search per controller..

eg.

customer controller method
SQL
public ActionResult search(string id)
     {
         var cust = from x in db.customers
                    where
                        x.cust_Name.Equals(id)
                    select x;
         return View(cust.ToList());

     }


customer index

XML
<h3>Enter name to search for customer details</h3>
<form action="search" method="get">
    <img src="~/Images/search.png" /><input type="text" name="id" /><input type="submit" value="search" class="but" />
    <table>


I would really appreciate the help
thank you
Posted

1 solution

 
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