To have simple transactions in you .Net application with Oracle do this
1. Encapsulate your transaction code with
using (var scope = new System.Transactions.TransactionScope())
{
// your transaction code
}
2. Add reference to Oracle.ManagedDataAccessDTC.dll
3. Deploy your code to server
If you get exception like
Could not load file or assembly 'Oracle.ManagedDataAccessDTC.dll' or one of its dependencies.
or
Failed to find or load the registered .Net Framework Data Provider
a. Then make sure you have the Oracle.ManagedDataAccessDTC.dll in the bin directory in your deployed code.
b. Also make sure you do NOT have any entry like this in your web.config
<add assembly="Oracle.ManagedDataAccessDTC, Version=4.121.1.0, Culture=neutral"/>
basically let .Net load the assembly from GAC
c. If you still have the exception then you may have to do the following
1. Encapsulate your transaction code with
using (var scope = new System.Transactions.TransactionScope())
{
// your transaction code
}
2. Add reference to Oracle.ManagedDataAccessDTC.dll
3. Deploy your code to server
If you get exception like
Could not load file or assembly 'Oracle.ManagedDataAccessDTC.dll' or one of its dependencies.
or
Failed to find or load the registered .Net Framework Data Provider
a. Then make sure you have the Oracle.ManagedDataAccessDTC.dll in the bin directory in your deployed code.
b. Also make sure you do NOT have any entry like this in your web.config
<add assembly="Oracle.ManagedDataAccessDTC, Version=4.121.1.0, Culture=neutral"/>
basically let .Net load the assembly from GAC
c. If you still have the exception then you may have to do the following
- install Microsoft Visual C++ 2010 Redistributable (DTC –> COM based transaction processing)
- restart IIS