All the demos of Visual Studio Lightswitch use SQL-Server, it is possible to access data from Oracle using Visual Studio Lightswitch?
-
see also http://meta.stackexchange.com/questions/59759/what-should-the-tag-for-visual-studio-lightswitch-be – Ian Ringrose Aug 05 '10 at 12:03
-
Ian: I left an answer for you. You have three options (1) Oracle's ODP.Net 11.2 R4, (2) Third Party Drivers $$$, and (3) Open Source. @Matt Eisenberg was on the right track, but there's more options. – one.beat.consumer Jan 19 '12 at 00:43
4 Answers
Yes, if you can get a third-part provider for the entity framework. I actually asked this question at VSLive this week.

- 183
- 6
- 21
-
how much do the third-part provider for the entity framework cost? And does someone need to know how to program to hook it into Lightswitch? – Ian Ringrose Aug 06 '10 at 08:23
-
http://web.datadirect.com/products/net/net-for-oracle/index.html. Not sure about the second part of your question. – matt eisenberg Aug 07 '10 at 00:29
-
As far the second part, I believe, that once it's installed on the person's machine, they just choose that as a data source. They'll need to know connection information, just as if they were using any other data source. But shouldn't need programming knowledge to hook it up. – Jeff Sheldon Aug 23 '10 at 12:37
Visual Studio Lightswitch can be persisted to an Oracle Database via the Entity Framework.
Oracle Data Provider (ODP.Net)
Oracle's ODAC Tools contains the Oracle Data Provider (ODP.Net) for use with Visual Studio applications. Oracle's latest driver with support for Entity Framework 4.1 and "Model First" approach.
EDIT: I am not sure if it supports "Code-First" or EF 4.2 so check documentation. That said, it's free and supported by Oracle so I would strongly suggest starting here before rolling your own, or using open source providers/drivers.
Notes: "11.2.0.2 Release 4" will cut it, but "11.2.0.3 is" out and more stable.
Third party drivers are available for purchase:
Open Source Providers
In addition there are some open source options available - one I found on Github:
Tutorial on MSDN: How to Connect Lightswitch to EF 4.1

- 9,414
- 11
- 55
- 98
-
Is there every a version of the Oracle's ODAC Tools that is not in beta but does fully surport the shipping version of .net? – Ian Ringrose Jan 19 '12 at 09:58
-
Yes. I forgot to edit my answer - 11.2.0.3 is is fully released, not beta... and it supports Entity Framework 4.1 - caveat: it supports "model first" and "4.1"... you'd have to read documentation or ask Support if 4.1 and Code-First approaches are good. – one.beat.consumer Jan 19 '12 at 17:29
I have used the latest ODAC 11.2 Release 4 (11.2.0.3.0) that supports Entity Framework, and it works fine.
If you get this error, "Inner exception message: Connection is already part of a local or a distributed transaction"
you can resolve the issue by following the second post by BScholz, https://forums.oracle.com/forums/thread.jspa?threadID=2263095
Basically, you need to implement SaveChanges_Excuting and SaveChanges_Excuted for the Oracle Data Source.
- Switch to "File View" (LightSwitch will display "Logical View" by default).
- Add a reference to "System.Transactions" in Server project.
- Switch back to "Logical View"
- Right Click the Data Source Name and click "View Code" to edit partial class.
Copy-and-paste the code below:
private TransactionScope _tscope; partial void SaveChanges_Executing() { _tscope = new TransactionScope(TransactionScopeOption.Required, new TransactionOptions { IsolationLevel = System.Transactions.IsolationLevel.ReadCommitted }); } partial void SaveChanges_Executed() { _tscope.Complete(); _tscope.Dispose(); }

- 2,221
- 22
- 23
The LightSwitch training kit has an exercise dedicated to using alternative data sources via WCF RIA services.
You might find that useful.

- 21,321
- 22
- 95
- 134

- 3,505
- 1
- 15
- 19