I have built an ASP.NET MVC 4 C# application that has Many to One relationships. The application currently uses SQL as data provider. The following is the data connection string I use:

<add name="LanguageServicesDB" connectionString="Data Source=(LocalDb)\v11.0;Initial Catalog=aspnet-LanguageServices-20121108111300;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnet-LanguageServices-20121108111300.mdf" providerName="System.Data.SqlClient" /> 

Now I was asked to have all the data available in a 2007 Sharepoint Server. Is it possible to have Sharepoint as my data source instead of SQL?

I tried few things using this page but nothing worked: http://www.connectionstrings.com/sharepoint

  • Bear in mind that SharePoint does not handle table/list relationships well so your code will have to account for that. Also, interacting with SharePoint means going through multiple abstraction layers per transaction so things will be slower overall. If this is a high volume site or has tens of thousands of records, it might make more sense to keep your data in SQL but use BCS to connect to the SQL and make the data visible to SharePoint – Dave Wise Dec 4 '12 at 19:42
  • @DaveWise I was already writing up your latter suggestion to use BDC (since it's 2007). That sounds like the better approach to me here. – RJ Cuthbertson Dec 4 '12 at 19:44

What John said is true. You ought not directly interact with the SharePoint databases.

However, when you state "Now I was asked to have all the data available in a 2007 Sharepoint Server" what it sounds like you actually need here is the Business Data Catalog service available in SharePoint 2007. It allows you to surface and interact with the data in your existing databases via the SharePoint UI. Your data will still live in the same database / structure as your ASP.NET MVC 4 application currently has set up.

Business Data Catalog: Overview describes:

One of the major design goals for Business Data Catalog is to enable you to surface business data from various LOB applications such as SAP, Siebel, and databases in Office SharePoint Server 2007 with minimal coding effort. To achieve this goal, Business Data Catalog provides homogeneous access to the underlying data sources with a metadata model that provides a consistent and simplified client object model.

For the complete MSDN documentation on BDC in SharePoint 2007 see Business Data Catalog - MSDN.

| improve this answer | |
  • Thank you, I explored Business Data Catalog and it seems to be the best approach to this problem. – Maher Manoubi Dec 10 '12 at 17:26
  • No problem, happy to help. – RJ Cuthbertson Dec 10 '12 at 18:05

It is not supported by Microsoft to query SharePoint SQL databases directly. Doing so will result in making your SharePoint environment not supportable by Microsoft.

With that said, you can use the SharePoint 2007 web services to retrieve data from the SharePoint 2007 Object Model.


Here is a detailed article from Microsoft on the GetListItems method of the Lists.asmx web service: http://msdn.microsoft.com/en-us/library/lists.lists.getlistitems(v=office.12).aspx

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.