title: Not able to fetch Sharepoint List data using CAML query
body: <p>I am trying to fetch data from SP list using the CAML query listed below.</p>
  
  <p><strong>CAML Query</strong></p>
  
  <pre><code>oQuery.Query = "&lt;Where&gt;&lt;Eq&gt;&lt;FieldRef Name='" 
      + jTitleMappingList.Fields["SET Area"].InternalName + "'/&gt;"
      + "&lt;Value Type='LOOKUP'&gt;" + ddlSubsite.SelectedValue
      + "&lt;/Value&gt;&lt;/Eq&gt;&lt;/Where&gt;";
  </code></pre>
  
  <p><strong>Error Message Faced:</strong></p>
  
  <blockquote>
    <p>{Microsoft.SharePoint.SPException: One or more field types are not
    installed properly. Go to the list settings page to delete these
    fields. ---> System.Runtime.InteropServices.COMException (0x81020014):
    One or more field types are not installed properly. Go to the list
    settings page to delete these fields.    at
    Microsoft.SharePoint.Library.SPRequestInternalClass.GetListItemDataWithCallback2(IListItemSqlClient
    pSqlClient, String bstrUrl, String bstrListName, String bstrViewName,
    String bstrViewXml, SAFEARRAYFLAGS fSafeArrayFlags,
    ISP2DSafeArrayWriter pSACallback, ISPDataCallback pPagingCallback,
    ISPDataCallback pPagingPrevCallback, ISPDataCallback
    pFilterLinkCallback, ISPDataCallback pSchemaCallback, ISPDataCallback
    pRowCountCallback, Boolean&amp; pbMaximalView)    at
    Microsoft.SharePoint.Library.SPRequest.GetListItemDataWithCallback2(IListItemSqlClient
    pSqlClient, String bstrUrl, String bstrListName, String bstrViewName,
    String bstrViewXml, SAFEARRAYFLAGS fSafeArrayFlags,
    ISP2DSafeArrayWriter pSACallback, ISPDataCallback pPagingCallback,
    ISPDataCallback pPagingPrevCallback, ISPDataCallback
    pFilterLinkCallback, ISPDataCallback pSchemaCallback, ISPDataCallback
    pRowCountCallback, Boolean&amp; pbMaximalView)    --- End of inner
    exception stack trace ---    at
    Microsoft.SharePoint.SPGlobal.HandleComException(COMException comEx)<br>
    at
    Microsoft.SharePoint.Library.SPRequest.GetListItemDataWithCallback2(IListItemSqlClient
    pSqlClient, String bstrUrl, String bstrListName, String bstrViewName,
    String bstrViewXml, SAFEARRAYFLAGS fSafeArrayFlags,
    ISP2DSafeArrayWriter pSACallback, ISPDataCallback pPagingCallback,
    ISPDataCallback pPagingPrevCallback, ISPDataCallback
    pFilterLinkCallback, ISPDataCallback pSchemaCallback, ISPDataCallback
    pRowCountCallback, Boolean&amp; pbMaximalView)    at
    Microsoft.SharePoint.SPListItemCollection.EnsureListItemsData()    at
    Microsoft.SharePoint.SPFieldCollection.PopulateReturnedFieldsSafeArray()
    at
    Microsoft.SharePoint.SPFieldCollection.EnsureFieldsSafeArray(Boolean
    bGetFullXML)    at Microsoft.SharePoint.SPFieldCollection.get_Count() 
    at Microsoft.SharePoint.SPFieldCollection.get_Item(Int32 iIndex)    at
    AZ.SharePoint.RST.AddUsersFromExcelUtility.RSTArchiveSetArea.RSTArchiveSetAreaUserControl.b__0()}</p>
  </blockquote>
  
  <p>I have tried creating a custom view with columns getting added one-by-one but it did not work out as well for finding the column with the issue. And also have tried adding the column with internal name for referring the CAML query filter but after that too the query does not fetch the required results.</p>