title: MAX(id) using SqlDataReader C#
body: <p>How do I change this:</p>
  
  <pre><code>        using (SqlCommand myCommand = myConnection.CreateCommand())
          {
              myConnection.Open();
              myCommand.CommandText = "SELECT FormID FROM tbl_Form";
              using (SqlDataReader reader = myCommand.ExecuteReader())
              {
                  while (reader.Read())
                  {
                      int FormID = reader.GetInt32(reader.GetOrdinal("FormID"));
                      MessageBox.Show(FormID.ToString());
                  }
              }
          }
  </code></pre>
  
  <p>to get <strong>MAX(FormID)</strong> ?</p>
  
  <p>My natural tendency is to throw a MAX around FormID but I'm getting an IndexOutOfRange exception.</p>