I am getting the error "New transaction is not allowed because there are other threads running" in an application I am working on. It has arisen during refactoring and specifically during creation of a test suite.
I realise from looking around that it means that I probably have a data reader still open when I am creating the transaction, however it's a complex app and it's not obvious to me where the problem is. Therefore I'd like to be able to work out what readers are connected to the SqlConnection in question.
Ideally I want to be able to add a watch in Visual Studio and then step through in debug mode to see when the number of connected readers change.
Is there any way to do this? I am working in C#.
Thanks in advance.
Martin