Be carefull about this way of working with DB. You must free the connections as fast as you can and I'm not sure you can do like this way.
What happen if you dispose the connection ? That would be the usual way of freeing the queue (or thru the 'using' blocks). /Gabriel -----Original Message----- From: Philippe Grohrock <[email protected]> Date: Mon, 20 Aug 2012 19:28:07 To: <[email protected]> Subject: Re: [Mono-list] Questions about coding style Thanks for the reply already and I'm sorry, I should've added the lines of code. static class GlobalVariables { public static MySqlConnection connection = new connection(); } This way the whole program has access to it and can modify/query the DB when needed (this is what I meant with global). At the moment I have 2 of my windows using that connection, but there might be more in the future. So is this a bad way of doing it? Would it be better to have the connection be internal static? Should I declare it once after the start of the program and then hand it over to the windows? I think I also need to open a new topic about assemblies ;) ---------------- View this message in context: Re: Questions about coding style <http://mono.1490590.n4.nabble.com/Questions-about-coding-style-tp4656301p4656321.html> Sent from the Mono - General mailing list archive <http://mono.1490590.n4.nabble.com/Mono-General-f1490591.html> at Nabble.com. _______________________________________________ Mono-list maillist - [email protected] http://lists.ximian.com/mailman/listinfo/mono-list
