I have not found a good answer to my when/if it is ok to actually query a database using SQL or an ORM tool like EF or NHibernate over BCS.
I would imagine it is ok for Service applications to actually directly touch the databases they create/work on but what about a timer that is storing data it gathers into a database?
Just looking for some best practice on SharePoint with BCS or SQL/ORM and some reasoning behind it.
SharePoint is designed to use Business Connectivity Services when talking to external data sources. Making use this technology will bring you many benefits (Business Connectivity Services Benefits).
Please take a look at these articles/video:
- Business Connectivity Services in SharePoint Server 2010
- Using Business Connectivity Services in SharePoint 2010
- External Content Type in SharePoint Designer – SQL Server
- Creating BCS Applications
DmitryLightning Tools Check out our SharePoint tools and web parts | Lightning Tools Blog
The SharePoint 2010 Business Connectivity Services should not be used for Trivial Data Access Tasks (like a simple CRUD operations). The BCS framework is intended for operations other than CRUD. Basically if you want to Search External DAta from SharePoint 2010 and get results, or if you want to perform typical SharePoint style collaboration tasks, then you need to consider for BCS. It's a heavy weight framework.
On other hand the frameworks like NHibernate or EF should be used for straight-forward tasks which you want to perform from SharePoint 2010 web parts or SharePoint application pages
- 已标记为答案 Qiao WeiMicrosoft Contingent Staff, Moderator 2012年8月16日 5:50