DB Connect with App

  • Thread starter Thread starter MadCrazyNewbie
  • Start date Start date
M

MadCrazyNewbie

Hey Again Group,

Sorry to be a pain:(

On my App I have serveral forms All with a Database Connection, and then
Several Data Adapters.

Is this the best way to do it? i.e have a seperate DataBase Connection on
each form, or should I have one Public one?

Thanks
MCN
 
Hi Simon,

In my opinion public one, however for that you have to rearrange a big part
of your current program, I would do it when I was you with your next
application.

Cor
 
Cor,

Going on my DB load where I would like it to have 3 Databases I could choose
from (Development, Live Network, and Local Network), I was thinking it might
be better for me to have 3 Database connections that are public to use, or
am i confusing the matter now?

Thanks
Si
 
Hi Simon,

Using the designer to make your database handling on your form, give you, a
great help in making all things like dataadapter and strong typed datasets.
You have seen that in your code where you changed the parameters, however
there is also a "dataset.vb" class, which is created when you generate the
dataset.

You can also make a shared class, where you do your entire database handling
that will make things easier when filling the database.

The point is how you do it; there is not one solution, at this moment I have
chosen to give the commands to that class because it is than easier to fill
the parameters, maybe I change that tomorrow again.

When you start using your shared class, you should have to make all your
update, delete, and insert, SQL strings that are difficult to make, or let
the command builder do that for you, for which is often said they are buggy
(however I think not for the way you are using the commands at this moment).

When you use your database class does it means that it makes you very free
from the (minor) problems that there are also using the designer.

My biggest problem with the designer created database handling was that I
could not make a dynamically connection string, however I showed you that
that is easy to overcome and you use it now even generic I see.

That is why my advice is not to rearrange your project yet. Wait until you
have overcome other problems, this problem is a design problem, and slightly
a performance question however very interesting when you want to save SQL
server connections in my opinion.

(I thought let me make a message William Ryan style)

:-)

Cor
 
Back
Top