Connect to Oracle database from a Sandbox WebPart
-
Friday, March 30, 2012 5:17 AM
Hi,
We have a need to connect to some oracle database from a sandbox solution. I tried to use BDC service but the solution gives deployment issues for Sandbox. We are not allowed for a farm solution in our production server and hence we need to consider the sandbox approach only.
any idea on how a DB connection can be achived into a Sandbox Solution?
Thanks,
ArchaHim
All Replies
-
Friday, March 30, 2012 8:02 AMInstead, you could create a sandbox proxy http://msdn.microsoft.com/en-us/library/ff798427.aspx or a separate wcf service ( http://sharepointdragons.com/2011/10/07/parallel-programming-in-sharepoint-2010-the-back-to-the-future-pattern/ ) that access the database and call either one of them from within the sandbox solution.
Kind regards,
Margriet BruggemanLois & Clark IT Services
web site: http://www.loisandclark.eu
blog: http://www.sharepointdragons.com
- Edited by Margriet Bruggeman Friday, March 30, 2012 8:02 AM
- Marked As Answer by Qiao WeiMicrosoft Contingent Staff, Moderator Thursday, April 05, 2012 11:17 AM
- Unmarked As Answer by ArchaHim Friday, April 06, 2012 4:31 AM
-
Friday, April 06, 2012 4:33 AM
Hi Margriet,
Thanks for the reply. Can you please elaborate more on the WCF solution that you arre proposing?
Thanks.
ArchaHim
-
Friday, April 06, 2012 10:09 AMSure, while a sandbox proxy allows you to do it, in Dependency Injection circles there is considerable discussion that this is in fact an antipattern. If you'd create a WCF service (as decribed in the link I gave you, or otherwise) you'd be free to access the Oracle database. You're allowed to communicate to WCF service within sandboxed solutions as they are external systems and don't affect your SharePoint farm (of course you could create a WCF service that's able to wrack your farm, but that's the responsibility of the admin to allow a wcf service and install it).
Kind regards,
Margriet BruggemanLois & Clark IT Services
web site: http://www.loisandclark.eu
blog: http://www.sharepointdragons.com
-
Friday, April 13, 2012 7:28 AM
Thanks all for the reply.
I could do this by use of System.Data.OracleClient library and BDC model entities.
Thanks.
ArchaHim
- Marked As Answer by ArchaHim Friday, April 13, 2012 7:29 AM
-
Friday, April 13, 2012 2:16 PMI'm glad I could help and to see that you took the trouble to reward yourself as the answerer while I got nothing :-( (well actually, you took away something from me). That really makes me feel that the time I've spent on you was worth it...
Kind regards,
Margriet BruggemanLois & Clark IT Services
web site: http://www.loisandclark.eu
blog: http://www.sharepointdragons.com
-
Monday, April 16, 2012 5:08 AM
Hey Margriet,
Please don't take it personal. Actually the approach I used is none of the 2 you had suggested. I used BDC model to connect to the external database and formed external lists out of the new content types defined. This is what I have done -
I really appriciate reply from you. I will surely try sandbox proxy and parallel programming approach. I couldn't use these now; due to lack of my knowledge in that area and the time deadlines I had.
Thanks.
ArchaHim
-
Monday, April 16, 2012 5:23 AMIt's ok, really. Thx for the last reply though.
Kind regards,
Margriet BruggemanLois & Clark IT Services
web site: http://www.loisandclark.eu
blog: http://www.sharepointdragons.com

