title: Max() in LINQ Query
body: <p>I have a Column with DataType as Nvarchar(max)
  Sample Records:</p>
  
  <pre><code>Advisor_Code
  9001
  9002
  9003
  100001
  100001
  9011
  </code></pre>
  
  <p>I have tried this Query :</p>
  
  <pre><code>var code = (from a in db.advisor_Registration select a ).Max(a=&gt;a.advisor_Code);
  </code></pre>
  
  <p>It Returns 9011 but max Number is 100001 .
  How to fix it </p>