How can you manage the state of a database connection in ADO.NET?

  • By opening and closing the connection manually
  • By setting the ConnectionState property
  • By using connection pooling
  • By using transactions
The state of a database connection in ADO.NET can be managed by setting the ConnectionState property of the SqlConnection object. This property indicates whether the connection is open, closed, connecting, executing a command, or fetching results. By checking and setting this property, developers can ensure that connections are used appropriately and efficiently throughout the application.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *