Using MySQLConnection in C# does not close properly

Im unsure about mysqlconnection but the sql server counter part uses Connection pooling and does not close when you call close instead it puts it in the connection pool!

Edit: Make sure you dispose the Reader, Command, and Connection object!

Edit: Solved with the ConnectionString Parameter “Pooling=false” or the static methods MySqlConnection.ClearPool(connection) and MySqlConnection.ClearAllPools()

Leave a Comment