title: Return Max value with LINQ Query in VB.NET?
body: <p>I have a method that takes in an id, a start date, and and end date as parameters.  It will return rows of data each corresponding to the day of the week that fall between the date range.  The rows are all doubles.  After returning it into a DataTable, I need to be able to use LINQ in VB.NET to return the maximum value.  How can I achieve this?  Here is the initial setup?</p>
  
  <pre><code>Dim dt as DataTable = GetMaximumValue(1,"10/23/2011","11/23"/2011")
  
  'Do linq query here to return the maximum value
  </code></pre>
  
  <p>The other alternative is to just return a Maximum value just given an id which would be slightly easier to implement, so the method would look like this:</p>
  
  <pre><code>Dim dt as DataTable = GetMaximumValue(1)
  
  'Do linq query here to return maximum value
  </code></pre>
  
  <p><strong>Important</strong></p>
  
  <p>What if I want to query against a DataRow instead of a DataTable and the column names are not the same, they are something like <code>MaxForMon</code>, <code>MaxForTue</code>, MaxForWed`, etc... and I need to take the Maximum value (whether it is MaxForMon, MaxForTue, or some other column). Would an option for this be to alias the column returned in the stored proc?  The other thing I thought about was instead of doing this in LINQ, I probably should just handle it in the T-SQL.</p>