B
Bruce D
I'm developing my first VB.NET application and I want to use good coding
technique, but I'm a little confused about 'modules and 'classes'. I have
several windows forms that have to connect to my data (MySQL). During my
testing, I created a ODBCconnection object via code (I didn't want to use
the windows form object because I'm going to want to use this from other
forms)...and all was great. So, now I need to put that code in a place
where I can call it from other areas of my program...and that's where I
become confused on where I should store it and how I should store it.
First I added a new 'module' to my project and created a public sub...but I
can't seem to reference that from my windows form.
Second, I added a new 'class' to my project. This worked, but I thought it
was weird that I had to instantiate the object before calling the code.
Long story short...my question is how should I be storing this small bit of
code: module / class / something else??
TIA
-bruce duncan
technique, but I'm a little confused about 'modules and 'classes'. I have
several windows forms that have to connect to my data (MySQL). During my
testing, I created a ODBCconnection object via code (I didn't want to use
the windows form object because I'm going to want to use this from other
forms)...and all was great. So, now I need to put that code in a place
where I can call it from other areas of my program...and that's where I
become confused on where I should store it and how I should store it.
First I added a new 'module' to my project and created a public sub...but I
can't seem to reference that from my windows form.
Second, I added a new 'class' to my project. This worked, but I thought it
was weird that I had to instantiate the object before calling the code.
Long story short...my question is how should I be storing this small bit of
code: module / class / something else??
TIA
-bruce duncan