[Mono-list] Questions about coding style

Gabriel Ibanez gabriel.ibanez at live.com
Mon Aug 20 20:35:27 UTC 2012


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 <philippe.grohrock at gmail.com>
Date: Mon, 20 Aug 2012 19:28:07 
To: <mono-list at lists.ximian.com>
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.


More information about the Mono-list mailing list