So I am just getting back into VB after a long hiatus. I spend a lot of time with web development, specifically PHP w/MySQL.

When I connect to MySQL in PHP, the connection is opened when the page is loaded, and closed at the bottom of the page. Basically the connection is opened and closed on every single page load and all the queries I need are in between those connections.

Getting into VB now will be my first time using databases with VB, I looked at JMC's tutorial for connecting to DBs and I was able to load what I wanted into my datagrid view, and into text boxes, etc. So thats all bueno.

My question is, at what point are the database connections open. Do I connect to the database when I first load the program and keep it open until I close out. Or do I open and close the connection as needed when I need to interact with the db?