Can I use the SharePoint 2010 SQL Database through SharePoint from my App?
I wonder if there is a supported way to access the SharePoint 2010 SQL Server through an API?
I'm not talking about modifying any SharePoint Database directly (I know that that is still unsupported), but I'd like to store some data that my application needs, and instead of asking the user to enter a Connection String, I'd prefer to create my own database on the SQL Server that SharePoint uses.
I think I could use the new Service Application stuff, b开发者_如何转开发ut that seems a bit overkill?
From my perspective you still shouldn't mess with the SharePoint databases. By adding your own tables within the content database(s) you are still violating the supported way to do things, not the least breaking the best practices. The preferred way to store/read and manipulate data in SharePoint is by using Lists and Document Libraries.
You can also use the BDC, or BCS in SharePoint 2010.
Just to answer myself: The supported way is through a Service Application, which is only suitable for large scale things (It's a LOT of plumbing).
Theoretically one could also get an Instance of the SPDatabaseService and work with that.
精彩评论