Can I check if a transaction is currently started? #4485
-
I have a method where I run more than 1 query... There are times where it is run alone, and there are times where it's run as a part of a larger transaction. Is there a way for me to run |
Beta Was this translation helpful? Give feedback.
Answered by
igor-tkachev
Apr 18, 2024
Replies: 1 comment 1 reply
-
Sure. if (dataConnection.Transaction == null)
dataConnection.Close(); |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
timbze
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sure.