I’m testing database programming in vb.NET 2008 at the moment and try to find a way to use a database connection in different forms, so e.g. I put the the database-connection-component into one of the forms.
I know, I could access it by e.g. form1.databaseconnection.xxx, but is this the best way or can I “put” the connection into something more abstract which all forms know about?
Thanks
I had to take a pretty similar design decision, and I decided that it would be the best to share the connection from one major object, and hand it to Forms by calling an overloaded Show()-Method.
MyController is a class which holds several important things, like the DB-Connection etc. .