Convert System.Transactions.Transaction.Current to System.Data.Common.DbTransaction?

  • Thread starter Thread starter Tim Cartwright
  • Start date Start date
T

Tim Cartwright

I have been trying to figure out a way to convert
System.Transactions.Transaction.Current to System.Data.Common.DbTransaction
with no luck so far. Is this even possible? I am using the Enterprise
Library, and several of their calls take in a transaction, but it is of type
DbTransaction. I have tried straight casting, but it is not compileable.

DbTransaction transaction = (DbTransaction)Transaction.Current;

Error 1 Cannot convert type 'System.Transactions.Transaction' to
'System.Data.Common.DbTransaction'
 
What are you trying to do, or why are you trying to do this? I suspect
this approach is a dead-end. Perhaps there is another approach to
handling your scenario (but you have to tell us what it is).

--Mary
 
Back
Top