I have create a simple .NET windows application which connects to MySQL database to select and insert data. Please see attached code. Iam accessing about four tables in MySQL to load a grid. Upon loading the grid, the connections are not closing and their status is "Sleep" when I check "Show Processlist".
I am calling mysqlconn.close() after every function. Do I need to do anything else. The connections get closed only when the windows application is closed.
This applciation is used in such a way that users open it once and click the "process" button (Click event btnprocessrt_click) several times before closing the application. The event is creating 3-4 connections for every click and the Database is reaching the maximum connections. How can this be fixed?