title: I want to get the maximum number in a particular column of sharepoint 2010 list
body: <p>Below is the query that I am trying </p>
  
  <pre><code> SPQuery query = new SPQuery();
   query.RowLimit = 1;
   query.Query = "&lt;Query&gt;&lt;OrderBy&gt;&lt;FieldRef Name='Identifier' Ascending='False' /&gt;&lt;/OrderBy&gt;&lt;/Query&gt;";
   SPListItemCollection Items = list.GetItems(query);
   if (Items.Count &gt; 0)
   {
   SPListItem item = Items[0];
   maxValue = (int)item["Identifier"];
   }
  </code></pre>
  
  <p>This is the error that I am getting *<em>strong text</em>*Specified cast is not valid.</p>