using System; using System.Collections.Generic; using System.Text; using MySql.Data.MySqlClient; namespace Bug24373 { class Program { //;//Connection Timeout=5;Pooling=false;Max Pool Size=80;Min Pool Size=20; private const string _connectionString = "Server=localhost;port=3306;Database=test;uid=root;pwd=;Connection Timeout=50;logging=True;Maximum Pool Size=1"; public static void Main() { Console.WriteLine("Connecting to Mysql DB"); MySqlConnection connection1 = null; MySqlConnection connection2 = null; try { connection1 = GetConnection(); connection2 = GetConnection(); } catch (Exception ex) { Console.WriteLine(ex.Message); Console.ReadKey(); } finally { if (connection1 != null) { connection1.Dispose(); } if (connection2 != null) { connection2.Dispose(); } Console.WriteLine("\nPress any key to exit"); Console.ReadKey(); } } private static MySqlConnection GetConnection() { MySqlConnection connection = new MySqlConnection(_connectionString); connection.Open(); return connection; } } }