views:

2243

answers:

3

I currently use the Linq to SharePoint to retrieve data from several SharePoint lists.

This is my current preferred method of coding my way from ASP.NET and WinForms to retrieve this data.

My only issue with this project:

I have to manually generate the SPML file and add this to the development environment, compile it in the project, and only then I am able to use it to connect to the List.

This is great for projects that require connecting to the one and the same list always.

But I am having users creating new workspaces (sites) with each its own List from which I want to retrieve data automagically (same as linq to sharepoint does, but not statically).

Can you recommend your preferred way of accessing data from several SharePoint Lists and sites in C# WinForms and/or ASP.NET outside an actual SharePoint environment where I can specify the a new source site and list at run time?

Thanks

+5  A: 

You have several options both of which are going to require further research on your part they are:

  1. Use the SharePoint object model (Microsoft.Sharepoint.dll), you must be on a PC within the SharePoint farm.
  2. Use the SharePoint web services which can be found at SiteURL/_vti_bin/ you might want to start with Lists.asmx and work from there.

You are going to need some further research as I have said, but remember GIYF.

Charlie
+1 thank you for the input.One point though: it is possible to use the SharePoint Object Model outside the SharePoint Farm (its how I currently use Linq to SharePoint)
Ric Tokyo
A: 

Ric, in answer to your comment:

No not really as you cannot call into the Microsoft.SharePoint.dll from outside the farm. However you could write web services which use the object model to perform your tasks, as long as these are hosted within the SP farm then you can call these (obviously) from any client application which can see them.

Charlie
A: 

Try this, it will help you....

SharePoint List C# Part 1

sara