title: C# MVC Query with WHERE clause and 2 params from the View
body: <p>I need to query my database with a WHERE clause and pass to parameters from my view to the controller. I am at a total loss as I am a JavaScript and PHP developer and am currently learning dotnet MVC (I am using vs10 framework4).</p>
  
  <p>I need to in essence make this query:</p>
  
  <pre><code>select * from myTable where column1=16 and column2=24
  </code></pre>
  
  <p>The values of column1 and column2 are in my View.  I have found a million examples on how to pull either a whole table, or a result based upon one parameter, I cannot figure out how to do that simple query.</p>
  
  <p>This seems like a simple task and I would appreciate any help as I have spent 5 hours trying to figure this out.</p>
  
  <p>Here are some key components of my code that will hopefully help someone help me.  I sincerely appreciate any help.</p>
  
  <p>Controller:</p>
  
  <pre><code>    public class SignBuilderController : Controller
      {
  
  
          SignBuilderModel signBuilderModel = new SignBuilderModel();
  
  
          //
          // Initialize database entities
          SignBuilderEntities _db;
          public SignBuilderController()
          {
              _db = new SignBuilderEntities();
          }
  
   //
          // Get /SignBuilder/PrintSetup
          [Authorize]
          public ActionResult PrintSetup()
          {
  
              var pricesList = signBuilderModel.GetPricingList().ToList();
              return View("PrintSetup", pricesList);
  
          }
  
  
  
  // get Column1 and column 2 query
  public ActionResult TestPage(int column1, int column1) 
  {
       //do something here
       return View();
  }
  </code></pre>
  
  <p>And in my View I would retrieve the values for my where clause from input fields.
  Example:</p>
  
  <pre><code>&lt;input type="text" name="column1value" id="column1value" /&gt;
  &lt;input type="text" name="column2value" id="column2value" /&gt;
  </code></pre>
  
  <p>Obviously I am using a Model as well, so if that is needed to make this work no problem.  I am really looking for sample code I can use as an example to learn from.  I really appreciate any help, and am about to pull out my hair.</p>