The rule of thumb is "open as late as possible. Close asap". Use "using" statement will ensure that.
Take a look at
http://msdn.microsoft.com/en-us/library/vstudio/yh598w02.aspx.
For this reason, I usually do this:
using(MySqlConnection con= new MySqlConnetion(connectionString)
{
con.open();
// perform database query here
} //con gets closed and disposed immediately upon exits
There is a good example here:
http://www.dotnetperls.com/sqlconnection