Can I specify the name of the transaction in the TransactionScope

I know that I can specify the name of the transaction

SqlConnection.BeginTransaction("SampleTransaction"); 

But it seems that if there is no way TransactionScope. Can anyone give some hints?

+4
source share
1 answer

No.

The reason is that the classes in the namespace System.Transaction can be applied to any transactional resource, not only to SQL Server.

However, if you have TransactionScope , which manages transactions with SQL Server, and also said, transactional file system, such as the NTFS , the name has no meaning for NTFS.

If you want to use the name and only use SQL Server, you need to manage the transaction of SqlConnection class (as you have shown to the method call BeginTransaction , otherwise there is no way to do it using TransactionScope (even though I thought it would be some kind of information, even as an extension to TransactionInformation class ).

+2
source

All Articles