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

SharePoint Code Works In Console Application But Not In Webservice/Webapp

$
0
0

(Not Running on a Server environment)

I have a task that requires reading a whole SharePoint list and upload the data to an SQL database later on. It works flawless, without any errors or anything in a console application. However, it requires to be created using a Webservice or a Webapp. The code is in a class library and I am testing it in the console application using the .dll file as a reference. As soon as I try to do the same in a Webservice/Webapp, nothing happens.No errors, either, nothing at all. I think it must be ignoring the whole SharePoint code somehow. I am kind of desperate here, as I have not been receiving any solutions/hints for 2 weeks now already. 

Here is a code snippet from my code (the whole code looks like this, only with more columns from the SharePoint list):

clientContext.Load(collListItem, items => items.Include(
            item => item["Title"]));

foreach (ListItem oListItem in collListItem)
            {
                titles.Add(oListItem["Title"]);
            }

I am using: ClientContext clientContext; ListItemCollection collListItem; SP = Microsoft.SharePoint.Client; SP.List oList; CamlQuery camlQuery; 

this.collListItem = oList.GetItems(camlQuery);



Viewing all articles
Browse latest Browse all 7589

Trending Articles



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