Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

retrieve sharepoint list items that also include lookup columns

$
0
0

Hi,

I have a list similar to the one shown below. I am trying to retrieve the list items ,but the lookup columns are not getting retrieved. Pls guide me through the code.I just tried the below  ,but no luck.

            

string siteUrl = "https://abc.sharepoint.com/sales/main";

             ClientContext clientContext = new ClientContext(siteUrl);
             var securePassword = new SecureString();
             var password = "jhnbkjnkjnj";

             foreach (char c in password.ToCharArray()) securePassword.AppendChar(c);
             clientContext.Credentials = new SharePointOnlineCredentials(@"jknkjnkjjk", securePassword);

             List oList = clientContext.Web.Lists.GetByTitle("DataPermissionList");

             CamlQuery camlQuery = new CamlQuery();
             camlQuery.ViewXml = "< View >< RowLimit > 100 </ RowLimit ></ View > ";
             ListItemCollection collListItem = oList.GetItems(camlQuery);

             clientContext.Load(collListItem);
             clientContext.ExecuteQuery(); 

             foreach (ListItem oListItem in collListItem)
             {

             }

I want to fetch the list items and store them in datatable.



Viewing all articles
Browse latest Browse all 7589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>