Quantcast
Channel: SharePoint 2010 - Development and Programming forum
Viewing all articles
Browse latest Browse all 11571

Queries on retieving data from sharepoint list using client object model and SSIS

$
0
0

Hi,

I am trying to retrieve data from share point list with the below 2 approaches.

1<sup>st</sup> Approach:

Using Client Object model (used Microsoft.Sharepoint.Client andMicrosoft.Sharepoint.Client.Runtime DLL). Please find my code below.

           Console.WriteLine("Starting...")

           Dim siteUrl AsString = "https://compositedev.svccorp.com/apps/products/flowerplacement/"

           Console.WriteLine("URL is set...")

           Dim clientContext AsNewClientContext(siteUrl)

           Console.WriteLine("In process...")

           Dim listName AsString = "PlacementRequests"

           Dim oListAsList = clientContext.Web.Lists.GetByTitle(listName)

           Console.WriteLine("Page selected from URL...")

           Dim Query AsString = String.Empty

           Dim CQuery AsNewCamlQuery

           CQuery.ViewXml = Query

           'Create a Collection            

           Dim ColListItems As Microsoft.SharePoint.Client.ListItemCollection = lst.GetItems(CQuery)

           Try

               Console.WriteLine("Entered try block...")

               'Load and execute the request to SharePoint server                

               clientContext.Load(ColListItems)

               clientContext.ExecuteQuery()

               Console.WriteLine("Executed...")

           Catch ex AsException

               Console.WriteLine("In Catch Block - inner...")

               ThrowNew Exception("Problem Accessing List", ex)

           EndTry

I am getting Null Exception Error at the above highlighted part. Please provide your inputs on how to move forward.

I am using Microsoft Visual Studio 2010 and the machine in which I am coding does not have share point installed in it.

Approach 2:  Using SSIS

Retrieving the data from share point link through SSIS using Sharepoint List Source and Destination. We are using Code flex component(Open Source) to export data, and it internally uses web service. Please let me know any other approach other than using code flex component using SSIS.

Thanks,

Swetha A


Viewing all articles
Browse latest Browse all 11571

Trending Articles



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