title: Getting error Specified argument was out of the range of valid values
body: <p>Am facing below mentioned error in share point 2013</p>
  
  <pre><code>Server Error in '/' Application.
  
  Specified argument was out of the range of valid values.
  
  Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 
  
  Exception Details: System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
  </code></pre>
  
  <p>the  code which is resulting this given below.</p>
  
  <pre><code>            SPList ConfigList = spWeb.Lists.TryGetList("GUID");
  
          SPQuery configQry = new SPQuery();
  
          string camlquery = @"&lt;Where&gt;&lt;Eq&gt;&lt;FieldRef Name='GuidName' /&gt;&lt;Value Type='Text'&gt;" + guid + "&lt;/Value&gt;&lt;/Eq&gt;&lt;/Where&gt;";
          configQry.Query = camlquery;
          SPListItemCollection ConfigItem = ConfigList.GetItems(configQry);
  
          if (ConfigItem != null)
          {
              if (ConfigItem.List != null)
                  if (ConfigItem[0] != null)
                      result = Convert.ToString(ConfigItem[0]["Captcha"]);
          }
  </code></pre>
  
  <p>can some one tell me what i am missing?? Sometimes it works and sometimes not</p>