Hello Lucius,
Thanks for Howdy's info.
According to your initial post, it seems you want to use Lightweight
transaction to enlist only one connection, however, meet an issue that
transaction scope told you it need enable MSDTC. Please correct me if I
misunderstand anything here. Thanks.
For Sql2k5, the transaction is managed by LTM until the second
SqlConnection connected to a different database comes into picture. But, In
Sql 2k, the transaction will be managed by MSDTC even if you have ONE
single database involved.
In my opinion, if your asp.net application connect single database and want
to use Lightweight transaction, I would like to recommend SqlTransaction.
SqlTransaction could only work on single databases and is Lightweight
transaction. The drawback is that you should explicitly enroll in the
transaction.
For the difference between SQLTranscation and TranscationScop, please refer
to
http://dotnetslackers.com/SQL/re-3498_SqlTransaction_vs_System_Transactions. aspx
[SqlTransaction vs. System.Transactions ]
For an example about how to use SQLTranscation, please refer to
http://msdn2.microsoft.com/en-us/library/system.data.sqlclient.sqltransactio n.commit.aspx
[SqlTransaction.Commit Method]
Hope this helps.
Sincerely,
Wen Yuan
Microsoft Online Community Support
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.