I was looking to get some items from an external List programmatically. I made the simple code as used with sharepoint list. But, an exception was fired => "Access denied".
After googling, i found that i didn't create the context object that allows the call to the external sevice. Here is the code :
SPServiceContext context = SPServiceContext.GetContext(mySite);
SPServiceContextScope contextScope = new SPServiceContextScope(context);
//.. add your code to retrieve items as used with sharepoint lists
Here is some code snippet for using External lists : http://msdn.microsoft.com/en-us/library/ff464347.aspx
After googling, i found that i didn't create the context object that allows the call to the external sevice. Here is the code :
SPServiceContext context = SPServiceContext.GetContext(mySite);
SPServiceContextScope contextScope = new SPServiceContextScope(context);
//.. add your code to retrieve items as used with sharepoint lists
Here is some code snippet for using External lists : http://msdn.microsoft.com/en-us/library/ff464347.aspx
Comments
Post a Comment