title: How to find the top number between a range given a value from a table using LINQ
body: <p>In my database I have the following table</p>
  
  <p><a href="https://i.stack.imgur.com/rvBHZ.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rvBHZ.jpg" alt="Database Table"></a></p>
  
  <p>I'm using LINQ to get data from the database</p>
  
  <pre><code> FlowCalcWeb.dbModelDataContext db1 = new FlowCalcWeb.dbModelDataContext();
    var EmergFlow = from p in db1.EmrgVents
                         where p.WettedArea == VarAtws
                         select new { p.VentingReq };
  </code></pre>
  
  <p>I want to get the top number between the range it fits, and retrieve <strong>VentingReq</strong></p>
  
  <p>Let's say my value is 55, it is between 50 and 60, the top number of this range in <strong>WettedArea</strong> is 60, so I want to retrieve from <strong>VentingReq</strong> 63200 </p>
  
  <p>Example 2, Given the number 47 as the <strong>wettedArea</strong>, I want retrieve from <strong>VentingReq</strong> 52700, </p>
  
  <p>I was thinking I could use some linq, using the aggreate functcion, find the closest value and then, get the next one, but not really  sure how to do this since I'm really new on C# LAMBDA, LINQ, stuff, </p>
  
  <p>Hope you can help me, Thanks!!</p>