Hi all,
Can we make a SQL connection within catch block of a c# code? If so what is the procedure to do it. Because when i tried i am getting error saying "The operation is not valid for the state of the transaction."
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Vincent Maverick DuranoPosted May 6, 2015, 8:30 AM
Nanhe SiddiquePosted May 6, 2015, 5:52 AM
When an exception is thrown, the common language runtime (CLR) looks for the catch statement that handles this exception. If the currently executing method does not contain such a catch block, the CLR looks at the method that called the current method, and so on up the call stack. If no catch block is found, then the CLR displays an unhandled exception message to the user and stops execution of the program.
so general structure of try catch block