Call Close method of connection object - ADO.NET

Q.  What happens when you call the Close method of a connection object?

1. The connection is destroyed.
2. The connection is returned to the connection pool.
3. The StateChangeevent is fired.
4. All non - committed pending transactions are rolled back.

- Published on 31 Aug 15

a. 1, 2
b. 1,3
c. 2, 3, 4
d. All of the above

ANSWER: 2, 3, 4
 
When you call close method of a connection objectStateChange event is fired, non - committed pending transactions are rolled back and connection is returned to the connection pool.

Post your comment / Share knowledge


Enter the code shown above:

(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)